Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ers::FIFOStream Class Reference

Queue stream. More...

#include <FIFOStream.h>

Inheritance diagram for ers::FIFOStream:

ers::Stream ers::Stream List of all members.

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 Issuereceive ()
 Receives an issue from the stream.
virtual Issuereceive ()
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

Detailed Description

Queue stream.

This streams is used to transmit Issues inside a process.

Author:
Matthias Wiesmann
Version:
1.0
Note:
This stream is not thread safe - it cannot depend on thread library.


Constructor & Destructor Documentation

ers::FIFOStream::FIFOStream  ) 
 

00028 : Stream() {} 

ers::FIFOStream::FIFOStream const FIFOStream other  ) 
 

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

ers::FIFOStream::~FIFOStream  ) 
 

00037 {}

ers::FIFOStream::FIFOStream  ) 
 

ers::FIFOStream::FIFOStream const FIFOStream other  ) 
 

ers::FIFOStream::~FIFOStream  ) 
 


Member Function Documentation

ers::Stream::operator std::string  )  const [inherited]
 

ers::Stream::operator std::string  )  const [inherited]
 

00035                                     {
00036     std::ostringstream stream ; 
00037     print_to(stream); 
00038     return stream.str(); 
00039 } // to string 

virtual void ers::FIFOStream::print_to std::ostream stream  )  const [virtual]
 

Reimplemented from ers::Stream.

void ers::FIFOStream::print_to std::ostream stream  )  const [virtual]
 

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

virtual Issue* ers::FIFOStream::receive  )  [virtual]
 

Receives an issue from the stream.

Reads an isssue on the stream

Returns:
the issue that has been read
Note:
This implementation always returns a null pointer

Reimplemented from ers::Stream.

ers::Issue * ers::FIFOStream::receive  )  [virtual]
 

Blocking read into the stream.

Returns:
a reference to the next Issue
Note:
This method is not implemented, pending some form of common TDAQ thread library.

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

virtual void ers::FIFOStream::send const Issue i  )  [virtual]
 

Sends an issue into the stream.

Sends the issue to the stream.

Parameters:
i the issue to send
Note:
This implementation silently discards the Issue

Reimplemented from ers::Stream.

void ers::FIFOStream::send const Issue i  )  [virtual]
 

Sends the issue into the stream. This method should put the issue into a FIFO queue and be non blocking

Parameters:
i pointer to the issue to send
Note:
This method is not implemented, pending some form of common TDAQ thread library.

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


Member Data Documentation

const char* const ers::FIFOStream::FIFO_STREAM_KEY [static]
 

Key for FIFO stream

const char *const ers::FIFOStream::FIFO_STREAM_KEY = "fifo" [static]
 

Key for FIFO stream

std::deque<Issue*> ers::FIFOStream::m_issue_queue [protected]
 

std::deque<Issue*> ers::FIFOStream::m_issue_queue [protected]
 

const char* const ers::Stream::NULL_STREAM_KEY [static, inherited]
 

Key for discard stream

const char *const ers::Stream::NULL_STREAM_KEY = "null" [static, inherited]
 

Key for discard stream


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 19:19:36 2011 for BOSS6.5.5 by  doxygen 1.3.9.1