AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
CNTV2Caption608MessageQueue Class Reference

I am a thread-safe queue of caption messages. Internally, I maintain two queues: one for high-priority messages, another for low-priority ones. Calling CNTV2Caption608MessageQueue::GetNextCaptionMessage will never return a low-priority message if a high-priority message is waiting to go out. More...

#include <ntv2caption608messagequeue.h>

Inheritance diagram for CNTV2Caption608MessageQueue:
[legend]
Collaboration diagram for CNTV2Caption608MessageQueue:
[legend]

Public Member Functions

 CNTV2Caption608MessageQueue ()
 
virtual ~CNTV2Caption608MessageQueue ()
 
virtual CNTV2Caption608MessagePtr GetNextCaptionMessage (void)
 Dequeues and returns my front-most caption message. If no messages are waiting to go out, I'll return a NULL (empty) CNTV2Caption608MessagePtr. More...
 
virtual bool EnqueueCaptionMessage (CNTV2Caption608MessagePtr inMsg)
 Enqueues the given caption message. High-priority messages go ahead of any/all low-priority messages. More...
 
virtual size_t Flush (void)
 Empties me. More...
 
virtual size_t Flush (const NTV2Line21Channel inChannel)
 Flushes all of my messages that are associated with the given caption channel. More...
 
virtual std::ostream & Print (std::ostream &inOutStream, const bool inDumpMessages=true) const
 Prints a human-readable representation of me to the given output stream in oldest-to-newest order. More...
 
virtual size_t GetQueuedMessageCount (void) const
 Answers with my current depth. More...
 
virtual size_t GetQueuedMessageCount (const NTV2Line21Channel inChannel) const
 Returns the number of messages queued for the given caption channel. More...
 
virtual size_t GetQueuedByteCount (void) const
 Answers with the total number of bytes (including command bytes) that I currently have queued. More...
 
virtual size_t GetQueuedByteCount (const NTV2Line21Channel inChannel) const
 Returns the number of message bytes queued for the given caption channel. More...
 
virtual size_t GetEnqueueByteTally (void) const
 Returns the total number of bytes (including command bytes) that have been enqueued onto me since I was instantiated. More...
 
virtual size_t GetDequeueByteTally (void) const
 Returns the total number of bytes (including command bytes) that have been dequeued from me since I was instantiated. More...
 
virtual size_t GetEnqueueMessageTally (void) const
 Returns the total number of messages that have been enqueued onto me since I was instantiated. More...
 
virtual size_t GetDequeueMessageTally (void) const
 Returns the total number of messages that have been dequeued from me since I was instantiated. More...
 
virtual size_t GetEnqueueByteTally (const NTV2Line21Channel inChannel) const
 Returns the total number of bytes (including command bytes) that have been enqueued onto me for the given caption channel since I was instantiated. More...
 
virtual size_t GetDequeueByteTally (const NTV2Line21Channel inChannel) const
 Returns the total number of bytes (including command bytes) that have been dequeued from me for the given caption channel since I was instantiated. More...
 
virtual size_t GetEnqueueMessageTally (const NTV2Line21Channel inChannel) const
 Returns the total number of messages that have been enqueued onto me for the given caption channel since I was instantiated. More...
 
virtual size_t GetDequeueMessageTally (const NTV2Line21Channel inChannel) const
 Returns the total number of messages that have been dequeued from me for the given caption channel since I was instantiated. More...
 
virtual size_t GetHighestQueueDepth (void) const
 Returns the highest queue depth – i.e., the maximum number of messages I held in either of my queues – since I was instantiated. More...
 
- Public Member Functions inherited from CNTV2CaptionLogConfig
 CNTV2CaptionLogConfig (const std::string inLogLabel=std::string())
 Default constructor. More...
 
virtual ~CNTV2CaptionLogConfig ()
 
virtual NTV2CaptionLogMask SetLogMask (const NTV2CaptionLogMask inLogMask)
 Specifies what, if any, debug information I will write to my log stream. More...
 
virtual NTV2CaptionLogMask GetLogMask (void) const
 Answers with my current caption logging bit mask. More...
 
virtual bool TestLogMask (const NTV2CaptionLogMask inLogMask, const bool inExact=false) const
 Answers true if the given log mask bits are set in my current log mask. More...
 
virtual void SetLogLabel (const std::string &inNewLabel)
 Specifies my logging label. More...
 
virtual void AppendToLogLabel (const std::string &inString)
 Appends the given string to my current log label. More...
 
virtual const std::string & GetLogLabel (void) const
 Answers with my current logging label. More...
 
virtual void SetLogStream (std::ostream &inOutputStream)
 
virtual std::ostream & LogIf (const NTV2CaptionLogMask inLogMask) const
 
virtual std::ostream & Log (void) const
 

Additional Inherited Members

- Static Public Member Functions inherited from CNTV2CaptionLogConfig
static std::ostream & DumpMemory (const void *pInStartAddress, const size_t inByteCount, std::ostream &inOutputStream=std::cout, const size_t inRadix=16, const size_t inBytesPerGroup=4, const size_t inGroupsPerLine=8, const size_t inAddressRadix=16, const bool inShowAscii=true, const size_t inAddrOffset=0)
 Dumps a contiguous chunk of memory in hex, octal, decimal, with or without ascii, to the given output stream. More...
 
static std::string HexDump32Bytes (const void *pInStartAddress, const size_t inByteCount, const size_t inLimitBytes=32)
 
static std::ostream & DumpYBytes_2vuy (const UByte *pInVideoLine, std::ostream &inOutputStream, const unsigned inFromPixel=0, const unsigned inToPixel=719, const bool inShowRuler=true, const unsigned inHiliteRangeFrom=9999, const unsigned inHiliteRangeTo=9999)
 Dumps the luma values in hexadecimal from the given line of '2vuy' video to the given output stream. More...
 
static std::ostream & DumpYBytes_2vuy (const std::vector< uint8_t > &inVideoLine, std::ostream &inOutputStream, const size_t inFromPixel=0, const size_t inToPixel=719, const bool inShowRuler=true, const size_t inHiliteRangeFrom=9999, const size_t inHiliteRangeTo=9999)
 Dumps the luma values in hexadecimal from the given line of '2vuy' video to the given output stream. More...
 
static std::string GetSeverityLabel (const unsigned inSeverity)
 
- Protected Attributes inherited from CNTV2CaptionLogConfig
NTV2CaptionLogMask mLogMask
 Determines what messages are logged. More...
 
std::string mLogLabel
 My debug label. More...
 
void * mpLabelLock
 Protects my debug label from simultaneous access by more than one thread. More...
 

Detailed Description

I am a thread-safe queue of caption messages. Internally, I maintain two queues: one for high-priority messages, another for low-priority ones. Calling CNTV2Caption608MessageQueue::GetNextCaptionMessage will never return a low-priority message if a high-priority message is waiting to go out.

Definition at line 20 of file ntv2caption608messagequeue.h.

Constructor & Destructor Documentation

◆ CNTV2Caption608MessageQueue()

CNTV2Caption608MessageQueue::CNTV2Caption608MessageQueue ( )

◆ ~CNTV2Caption608MessageQueue()

virtual CNTV2Caption608MessageQueue::~CNTV2Caption608MessageQueue ( )
virtual

Member Function Documentation

◆ EnqueueCaptionMessage()

virtual bool CNTV2Caption608MessageQueue::EnqueueCaptionMessage ( CNTV2Caption608MessagePtr  inMsg)
virtual

Enqueues the given caption message. High-priority messages go ahead of any/all low-priority messages.

Parameters
[in]inMsgThe message to be enqueued.

◆ Flush() [1/2]

virtual size_t CNTV2Caption608MessageQueue::Flush ( const NTV2Line21Channel  inChannel)
virtual

Flushes all of my messages that are associated with the given caption channel.

Parameters
[in]inChannelThe caption channel whose messages are to be removed.
Returns
The number of messages that were removed.

◆ Flush() [2/2]

virtual size_t CNTV2Caption608MessageQueue::Flush ( void  )
virtual

Empties me.

Returns
The number of messages that were removed.

◆ GetDequeueByteTally() [1/2]

virtual size_t CNTV2Caption608MessageQueue::GetDequeueByteTally ( const NTV2Line21Channel  inChannel) const
virtual

Returns the total number of bytes (including command bytes) that have been dequeued from me for the given caption channel since I was instantiated.

◆ GetDequeueByteTally() [2/2]

virtual size_t CNTV2Caption608MessageQueue::GetDequeueByteTally ( void  ) const
virtual

Returns the total number of bytes (including command bytes) that have been dequeued from me since I was instantiated.

◆ GetDequeueMessageTally() [1/2]

virtual size_t CNTV2Caption608MessageQueue::GetDequeueMessageTally ( const NTV2Line21Channel  inChannel) const
virtual

Returns the total number of messages that have been dequeued from me for the given caption channel since I was instantiated.

◆ GetDequeueMessageTally() [2/2]

virtual size_t CNTV2Caption608MessageQueue::GetDequeueMessageTally ( void  ) const
virtual

Returns the total number of messages that have been dequeued from me since I was instantiated.

◆ GetEnqueueByteTally() [1/2]

virtual size_t CNTV2Caption608MessageQueue::GetEnqueueByteTally ( const NTV2Line21Channel  inChannel) const
virtual

Returns the total number of bytes (including command bytes) that have been enqueued onto me for the given caption channel since I was instantiated.

◆ GetEnqueueByteTally() [2/2]

virtual size_t CNTV2Caption608MessageQueue::GetEnqueueByteTally ( void  ) const
virtual

Returns the total number of bytes (including command bytes) that have been enqueued onto me since I was instantiated.

◆ GetEnqueueMessageTally() [1/2]

virtual size_t CNTV2Caption608MessageQueue::GetEnqueueMessageTally ( const NTV2Line21Channel  inChannel) const
virtual

Returns the total number of messages that have been enqueued onto me for the given caption channel since I was instantiated.

◆ GetEnqueueMessageTally() [2/2]

virtual size_t CNTV2Caption608MessageQueue::GetEnqueueMessageTally ( void  ) const
virtual

Returns the total number of messages that have been enqueued onto me since I was instantiated.

◆ GetHighestQueueDepth()

virtual size_t CNTV2Caption608MessageQueue::GetHighestQueueDepth ( void  ) const
inlinevirtual

Returns the highest queue depth – i.e., the maximum number of messages I held in either of my queues – since I was instantiated.

Definition at line 138 of file ntv2caption608messagequeue.h.

◆ GetNextCaptionMessage()

virtual CNTV2Caption608MessagePtr CNTV2Caption608MessageQueue::GetNextCaptionMessage ( void  )
virtual

Dequeues and returns my front-most caption message. If no messages are waiting to go out, I'll return a NULL (empty) CNTV2Caption608MessagePtr.

◆ GetQueuedByteCount() [1/2]

virtual size_t CNTV2Caption608MessageQueue::GetQueuedByteCount ( const NTV2Line21Channel  inChannel) const
virtual

Returns the number of message bytes queued for the given caption channel.

Parameters
[in]inChannelSpecifies the caption channel of interest.
Returns
The current number of queued message bytes for the given caption channel.

◆ GetQueuedByteCount() [2/2]

virtual size_t CNTV2Caption608MessageQueue::GetQueuedByteCount ( void  ) const
virtual

Answers with the total number of bytes (including command bytes) that I currently have queued.

Returns
The current number of queued bytes.

◆ GetQueuedMessageCount() [1/2]

virtual size_t CNTV2Caption608MessageQueue::GetQueuedMessageCount ( const NTV2Line21Channel  inChannel) const
virtual

Returns the number of messages queued for the given caption channel.

Parameters
[in]inChannelSpecifies the caption channel of interest.
Returns
The current number of queued messages for the given caption channel.

◆ GetQueuedMessageCount() [2/2]

virtual size_t CNTV2Caption608MessageQueue::GetQueuedMessageCount ( void  ) const
virtual

Answers with my current depth.

Returns
The current number of queued messages.

◆ Print()

virtual std::ostream& CNTV2Caption608MessageQueue::Print ( std::ostream &  inOutStream,
const bool  inDumpMessages = true 
) const
virtual

Prints a human-readable representation of me to the given output stream in oldest-to-newest order.

Parameters
inOutStreamSpecifies the output stream to receive my human-readable representation.
[in]inDumpMessagesIf true, also dump my messages; otherwise don't dump my messages. Defaults to true.
Returns
The output stream that received my human-readable representation.

The documentation for this class was generated from the following file: