AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
ntv2caption708serviceblockqueue.h
Go to the documentation of this file.
1 
7 #ifndef __NTV2_CEA708_SERVICEBLOCKQUEUE_
8 #define __NTV2_CEA708_SERVICEBLOCKQUEUE_
9 
10 #include "ntv2captionlogging.h"
11 #include <deque>
12 #ifdef MSWindows
13  #include "windows.h"
14 #endif
15 
16 
20 typedef std::deque <UByte> UByteQueue;
21 typedef UByteQueue::iterator UByteQueueIter;
22 typedef UByteQueue::const_iterator UByteQueueConstIter;
23 
24 
29 {
30  // Instance Methods
31  public:
34 
38  virtual void Flush (void);
39 
43  virtual bool IsEmpty (void) const;
44 
48  virtual size_t GetCurrentDepth (void) const;
49 
53  virtual size_t GetHighestDepth (void) const;
54 
58  virtual size_t GetEnqueueTally (void) const;
59 
63  virtual size_t GetDequeueTally (void) const;
64 
68  virtual size_t GetEnqueueByteTally (void) const;
69 
73  virtual size_t GetDequeueByteTally (void) const;
74 
81  virtual bool PushServiceBlock (const UByte * pInServiceBlockData, const size_t inServiceBlockByteCount);
82 
92  virtual bool PeekNextServiceBlockInfo (size_t & outBlockSize, size_t & outDataSize, int & outServiceNum, bool & outIsExtended) const;
93 
100  virtual size_t PopServiceBlock (std::vector<UByte> & outData);
101 
108  virtual size_t PopServiceBlockData (std::vector<UByte> & outData);
109 
110 
111  virtual size_t PopServiceBlock (UByte * pOutDataBuffer);
112  virtual size_t PopServiceBlockData (UByte * pOutDataBuffer);
113 
114  // DEBUGGING
119  virtual void SetDebugChannel (const int inChannelNum);
120 
121  virtual std::ostream & Print (std::ostream & inOutStrm, const bool inWithData = false) const;
122 
123  private:
124  // Hide Stuff
126  virtual CNTV2Caption708ServiceBlockQueue & operator = (const CNTV2Caption708ServiceBlockQueue & inRHS);
127 
128  // Debug
129  virtual std::string GetChannelString (void) const;
130 
131 
132  // Instance Data
133  private:
134  UByteQueue mServiceBlockQueue;
135  mutable void * mpQueueLock;
136  int mDebugChannel;
137 
138  // Stats
139  size_t mEnqueueTally;
140  size_t mDequeueTally;
141  size_t mEnqueueByteTally;
142  size_t mDequeueByteTally;
143  size_t mHighestQueueDepth;
144 
145 }; // CNTV2Caption708ServiceBlockQueue
146 
147 
148 AJAExport std::ostream & operator << (std::ostream & inOutStrm, const CNTV2Caption708ServiceBlockQueue & inQueue);
149 
150 #endif // __NTV2_CEA708_SERVICEBLOCKQUEUE_
UByteQueue
std::deque< UByte > UByteQueue
A UByteQueue is a std::deque of unsigned byte values.
Definition: ntv2caption708serviceblockqueue.h:20
UByteQueueConstIter
UByteQueue::const_iterator UByteQueueConstIter
Definition: ntv2caption708serviceblockqueue.h:22
CNTV2Caption708ServiceBlockQueue
I am a simple, thread-safe queue of CEA-708 caption service blocks.
Definition: ntv2caption708serviceblockqueue.h:28
operator<<
std::ostream & operator<<(std::ostream &inOutStrm, const CNTV2Caption708ServiceBlockQueue &inQueue)
UByteQueueIter
UByteQueue::iterator UByteQueueIter
Definition: ntv2caption708serviceblockqueue.h:21
UByte
uint8_t UByte
Definition: ajatypes.h:250
AJAExport
#define AJAExport
Definition: export.h:33
CNTV2CaptionLogConfig
Definition: ntv2captionlogging.h:77
ntv2captionlogging.h
Declares the NTV2CaptionLogMask, and the CNTV2CaptionLogConfig class.