#include <FIFOStream.h>
Inheritance diagram for ers::FIFOStream:
Public Member Functions | |
FIFOStream (const FIFOStream &other) | |
FIFOStream () | |
FIFOStream (const FIFOStream &other) | |
FIFOStream () | |
operator std::string () const | |
operator std::string () const | |
virtual void | print_to (std::ostream &stream) const |
virtual void | print_to (std::ostream &stream) const |
virtual Issue * | receive () |
Receives an issue from the stream. | |
virtual Issue * | receive () |
virtual void | send (const Issue *i) |
Sends an issue into the stream. | |
virtual void | send (const Issue *i) |
~FIFOStream () | |
~FIFOStream () | |
Static Public Attributes | |
const char *const | FIFO_STREAM_KEY |
const char *const | FIFO_STREAM_KEY = "fifo" |
const char *const | NULL_STREAM_KEY |
const char *const | NULL_STREAM_KEY = "null" |
Protected Attributes | |
std::deque< Issue * > | m_issue_queue |
std::deque< Issue * > | m_issue_queue |
This streams is used to transmit Issues inside a process.
|
00028 : Stream() {}
|
|
00030 : Stream(other) { 00031 for(unsigned int i=0;i<other.m_issue_queue.size();i++) { 00032 Issue *cloned = other.m_issue_queue[i]->clone(); 00033 m_issue_queue.push_back(cloned); 00034 } // for 00035 } // FIFOStream
|
|
00037 {}
|
|
|
|
|
|
|
|
|
|
00035 { 00036 std::ostringstream stream ; 00037 print_to(stream); 00038 return stream.str(); 00039 } // to string
|
|
Reimplemented from ers::Stream. |
|
Reimplemented from ers::Stream. 00063 { 00064 stream << ers::FIFOStream::FIFO_STREAM_KEY << ":[" ; 00065 for(unsigned int i=0;i<m_issue_queue.size();i++) { 00066 stream << m_issue_queue[i]->what() ; 00067 if (i!=m_issue_queue.size()-1) { 00068 stream << ", " ; 00069 } // if not last 00070 } // for elements 00071 stream << "]" ; 00072 } // print_to
|
|
Receives an issue from the stream. Reads an isssue on the stream
Reimplemented from ers::Stream. |
|
Blocking read into the stream.
Reimplemented from ers::Stream. 00056 { 00057 if (m_issue_queue.empty()) return 0 ; 00058 Issue *issue = m_issue_queue[0] ; 00059 m_issue_queue.pop_front(); 00060 return issue ; 00061 } // receive
|
|
Sends an issue into the stream. Sends the issue to the stream.
Reimplemented from ers::Stream. |
|
Sends the issue into the stream. This method should put the issue into a FIFO queue and be non blocking
Reimplemented from ers::Stream. 00045 { 00046 ERS_PRE_CHECK_PTR(issue_ptr); 00047 Issue *cloned = issue_ptr->clone(); 00048 m_issue_queue.push_back(cloned); 00049 } // send
|
|
Key for FIFO stream |
|
Key for FIFO stream |
|
|
|
|
|
Key for discard stream |
|
Key for discard stream |