Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CDocumentedPacket Class Reference

#include <CDocumentedPacket.h>

List of all members.

Public Methods

 CDocumentedPacket (unsigned short nTag, const string &rName, const string &rDescription, const string &rVersion)
 Constructor.

virtual ~CDocumentedPacket ()
int operator== (const CDocumentedPacket &rhs) const
 < Comparison for equality.

int operator== (const string &rhs) const
int operator!= (const CDocumentedPacket &rhs) const
int operator!= (const string &rhs) const
unsigned short getTag () const
string getName () const
string getDescription () const
string getVersion () const
string getInstantiationDate () const
DAQWordBufferPtr getHeaderPtr () const
bool getPacketInProgress () const
string Format ()
DAQWordBufferPtr Begin (DAQWordBufferPtr &rPointer)
DAQWordBufferPtr End (DAQWordBufferPtr &rBuffer)

Private Methods

 CDocumentedPacket (const CDocumentedPacket &rhs)
 Copy constructor.

CDocumentedPacket & operator= (const CDocumentedPacket &rhs)
 Assignment.


Private Attributes

unsigned short m_nTag
 Tag identifying event in the buffer.

string m_sName
 String name of tag.

string m_sDescription
 Long description of tag.

string m_sVersion
 Version of the packet.

string m_sInstantiationDate
 Date/time object instantiated.

DAQWordBufferPtr m_pHeaderPtr
 'pointer' to header of current packet.

bool m_fPacketInProgress
 true if packet being built now.


Detailed Description

Encapsulates a documented packet for two purposes:

Definition at line 312 of file CDocumentedPacket.h.


Constructor & Destructor Documentation

CDocumentedPacket::CDocumentedPacket unsigned short    nTag,
const string &    rName,
const string &    rDescription,
const string &    rVersion
 

Constructor.

Default constructor. This is called when declarations of the form e.g.:

  • CDocumentedPacket object; are performed.

Definition at line 309 of file CDocumentedPacket.cpp.

References CDocumentedPacketManager::AddPacket(), CDocumentedPacketManager::getInstance(), and m_sInstantiationDate.

CDocumentedPacket::~CDocumentedPacket   [virtual]
 

Definition at line 330 of file CDocumentedPacket.cpp.

References CDocumentedPacketManager::DeletePacket(), CDocumentedPacketManager::getInstance(), m_fPacketInProgress, and m_sName.

CDocumentedPacket::CDocumentedPacket const CDocumentedPacket &    rhs [private]
 

Copy constructor.


Member Function Documentation

DAQWordBufferPtr CDocumentedPacket::Begin DAQWordBufferPtr &    rPointer
 

Requests a packet of this type be opened. Throws CInvalidPacketState if packet already open. m_fPacketInProgress -> true m_pHeader pointer is captured from the current pointer, Space is reserved for the word count, and the id is written. Pointer to the next free spot in the buffer is returned.

Parameters:
rPointer  Current pointer into the buffer.
Returns:
Pointer to body of packet.

Definition at line 383 of file CDocumentedPacket.cpp.

References m_fPacketInProgress, m_nTag, and m_pHeaderPtr.

Referenced by CCountingEventSegment::Read(), Hierarchy::Read(), and readevt().

DAQWordBufferPtr CDocumentedPacket::End DAQWordBufferPtr &    rBuffer
 

Closes a packet. If m_fPackteInProgress is false, throws CInvalidPacketState. Otherwise: m_fPacketInProgress -> false, the Buffer pointer is used to determine, and fill in the word count of the packet. A buffer pointer to the next slot is returned (to allow for the possibility there's trailer data too).

Parameters:
rBuffer  - Pointer to the first word after the packet.
Returns:
Pointer to the next word in the buffer to fill. In this version, that's just rBuffer, however, this allows for a trailer as well as a header to be inserted.

Definition at line 418 of file CDocumentedPacket.cpp.

References m_fPacketInProgress, and m_pHeaderPtr.

Referenced by CCountingEventSegment::Read(), Hierarchy::Read(), and readevt().

string CDocumentedPacket::Format  
 

Returns a formatted string describing the packet which can be inserted in a documentation buffer. This is returned as a colon separated set of fields:

  • Packet id
  • Packet Name
  • Packet Description
  • Packet Version
  • Packet instantiation date.

Definition at line 352 of file CDocumentedPacket.cpp.

References m_nTag, m_sDescription, m_sInstantiationDate, m_sName, and m_sVersion.

string CDocumentedPacket::getDescription   const [inline]
 

Definition at line 364 of file CDocumentedPacket.h.

References m_sDescription.

DAQWordBufferPtr CDocumentedPacket::getHeaderPtr   const
 

Get a pointer to the current packet. This throws CInvalidPacketState if there is not an open packet, and is therefore not a trivial selector.

Definition at line 433 of file CDocumentedPacket.cpp.

References m_fPacketInProgress, and m_pHeaderPtr.

string CDocumentedPacket::getInstantiationDate   const [inline]
 

Definition at line 372 of file CDocumentedPacket.h.

References m_sInstantiationDate.

string CDocumentedPacket::getName   const [inline]
 

Definition at line 360 of file CDocumentedPacket.h.

References m_sName.

bool CDocumentedPacket::getPacketInProgress   const [inline]
 

Definition at line 378 of file CDocumentedPacket.h.

References m_fPacketInProgress.

unsigned short CDocumentedPacket::getTag   const [inline]
 

Definition at line 356 of file CDocumentedPacket.h.

References m_nTag.

string CDocumentedPacket::getVersion   const [inline]
 

Definition at line 368 of file CDocumentedPacket.h.

References m_sVersion.

int CDocumentedPacket::operator!= const string &    rhs const [inline]
 

Definition at line 349 of file CDocumentedPacket.h.

References operator==().

int CDocumentedPacket::operator!= const CDocumentedPacket &    rhs const [inline]
 

Definition at line 344 of file CDocumentedPacket.h.

References operator==().

CDocumentedPacket& CDocumentedPacket::operator= const CDocumentedPacket &    rhs [private]
 

Assignment.

int CDocumentedPacket::operator== const string &    rhs const [inline]
 

Definition at line 340 of file CDocumentedPacket.h.

References m_sName.

int CDocumentedPacket::operator== const CDocumentedPacket &    rhs const [inline]
 

< Comparison for equality.

Definition at line 336 of file CDocumentedPacket.h.

References m_sName.

Referenced by operator!=().


Member Data Documentation

bool CDocumentedPacket::m_fPacketInProgress [private]
 

true if packet being built now.

Definition at line 321 of file CDocumentedPacket.h.

Referenced by Begin(), End(), getHeaderPtr(), getPacketInProgress(), and ~CDocumentedPacket().

unsigned short CDocumentedPacket::m_nTag [private]
 

Tag identifying event in the buffer.

Definition at line 315 of file CDocumentedPacket.h.

Referenced by Begin(), Format(), and getTag().

DAQWordBufferPtr CDocumentedPacket::m_pHeaderPtr [private]
 

'pointer' to header of current packet.

Definition at line 320 of file CDocumentedPacket.h.

Referenced by Begin(), End(), and getHeaderPtr().

string CDocumentedPacket::m_sDescription [private]
 

Long description of tag.

Definition at line 317 of file CDocumentedPacket.h.

Referenced by Format(), and getDescription().

string CDocumentedPacket::m_sInstantiationDate [private]
 

Date/time object instantiated.

Definition at line 319 of file CDocumentedPacket.h.

Referenced by CDocumentedPacket(), Format(), and getInstantiationDate().

string CDocumentedPacket::m_sName [private]
 

String name of tag.

Definition at line 316 of file CDocumentedPacket.h.

Referenced by Format(), getName(), operator==(), and ~CDocumentedPacket().

string CDocumentedPacket::m_sVersion [private]
 

Version of the packet.

Definition at line 318 of file CDocumentedPacket.h.

Referenced by Format(), and getVersion().


The documentation for this class was generated from the following files:
Generated on Fri Nov 8 13:37:13 2002 for Event Readout system. by doxygen1.2.16