Home Libraries Author Links

stm::tools::BaseMessage< ContextT > Class Template Reference
[BinMsg: Abstract Binary Message Model]

Inheritance diagram for stm::tools::BaseMessage< ContextT >:

Inheritance graph
[legend]
Collaboration diagram for stm::tools::BaseMessage< ContextT >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class ContextT>
class stm::tools::BaseMessage< ContextT >

Abstract base class of message types for scanning from its byte_iterator_range base class object.

ContextT shall be a specialization of BaseMessageContext or be publicly derived therefrom. If ContextT is a specialization of BinMessageContext (which is publicly derived from a BaseMessageContext specialization) or is publicly derived therefrom, ContextT is also a BinMessage<ContextT> factory and the types derived from BaseMessage<ContextT> can be registered as BinMessage<ContextT> types known to that factory (see BinMessageContext::registerMessageType()).

Definition at line 182 of file binmsg.hpp.


Public Types

enum  
 Scanned input data are organized as 32 bit words. More...
enum  
 Bitwise orable flag bits. More...
enum  
 Status values. More...
typedef ContextT context_type
 Context type of the messages to be scanned.
typedef BaseMessage< ContextT > basemessage_type
 This type.
typedef context_type::Timestamp Timestamp
 Timestamp type.

Public Member Functions

virtual ~BaseMessage ()
 Virtual destructor to allow polymorphic class hierarchies.
virtual const std::string & type () const =0
 Return the message type string.
dword flags () const
 Returns the flags of the message.
dword status () const
 Returns the status of the message.
const Timestamptimestamp () const
 Returns a reference to the message's timestamp.
context_typecontext ()
 Returns the the message's context.
const byte_iterator_rangebody () const
 Returns the byte range consisting of the message's body excluding any padding bytes.

Protected Member Functions

 BaseMessage (const byte *first, const byte *last, context_type &context, dword flags=NoFlags, dword status=NoError)
 Since BaseMessage is an abstract base class, this constructor is used only by derived classes.
void setStatus (dword val)
 Sets the status of the message to val.
void setBody (const byte_iterator_range &body)
 Sets the the byte range consisting of the message's body excluding any padding bytes.
void setUdpTimestamp (word bfn, dword bordTimeSec, word boardTimeMs, dword seqNo)
 Sets the message's timestamp according to the UDP timing data supplied.
void setFpgaTimestamp (word bfn, byte slot, word chip)
 Sets the message's timestamp according to the FPGA timing data supplied.

Member Typedef Documentation

template<class ContextT>
typedef ContextT stm::tools::BaseMessage< ContextT >::context_type

Context type of the messages to be scanned.

Reimplemented in stm::tools::McBspMessage< ContextT >, and stm::tools::PrintkBinMessage< ContextT >.

Definition at line 191 of file binmsg.hpp.

template<class ContextT>
typedef BaseMessage<ContextT> stm::tools::BaseMessage< ContextT >::basemessage_type

This type.

Reimplemented in stm::tools::McBspMessage< ContextT >, and stm::tools::PrintkBinMessage< ContextT >.

Definition at line 194 of file binmsg.hpp.

template<class ContextT>
typedef context_type::Timestamp stm::tools::BaseMessage< ContextT >::Timestamp

Timestamp type.

Definition at line 197 of file binmsg.hpp.


Member Enumeration Documentation

template<class ContextT>
anonymous enum

Scanned input data are organized as 32 bit words.

Definition at line 200 of file binmsg.hpp.

template<class ContextT>
anonymous enum

Bitwise orable flag bits.

Definition at line 206 of file binmsg.hpp.

template<class ContextT>
anonymous enum

Status values.

Definition at line 213 of file binmsg.hpp.


Constructor & Destructor Documentation

template<class ContextT>
virtual stm::tools::BaseMessage< ContextT >::~BaseMessage (  )  [virtual]

Virtual destructor to allow polymorphic class hierarchies.

template<class ContextT>
stm::tools::BaseMessage< ContextT >::BaseMessage ( const byte *  first,
const byte *  last,
context_type context,
dword  flags = NoFlags,
dword  status = NoError 
) [protected]

Since BaseMessage is an abstract base class, this constructor is used only by derived classes.


Member Function Documentation

template<class ContextT>
virtual const std::string& stm::tools::BaseMessage< ContextT >::type (  )  const [pure virtual]

Return the message type string.

Implemented in stm::tools::McBspMessage< ContextT >, and stm::tools::PrintkBinMessage< ContextT >.

template<class ContextT>
dword stm::tools::BaseMessage< ContextT >::flags (  )  const

Returns the flags of the message.

template<class ContextT>
dword stm::tools::BaseMessage< ContextT >::status (  )  const

Returns the status of the message.

template<class ContextT>
const Timestamp& stm::tools::BaseMessage< ContextT >::timestamp (  )  const

Returns a reference to the message's timestamp.

template<class ContextT>
context_type& stm::tools::BaseMessage< ContextT >::context (  ) 

Returns the the message's context.

template<class ContextT>
const byte_iterator_range& stm::tools::BaseMessage< ContextT >::body (  )  const

Returns the byte range consisting of the message's body excluding any padding bytes.

template<class ContextT>
void stm::tools::BaseMessage< ContextT >::setStatus ( dword  val  )  [protected]

Sets the status of the message to val.

template<class ContextT>
void stm::tools::BaseMessage< ContextT >::setBody ( const byte_iterator_range body  )  [protected]

Sets the the byte range consisting of the message's body excluding any padding bytes.

template<class ContextT>
void stm::tools::BaseMessage< ContextT >::setUdpTimestamp ( word  bfn,
dword  bordTimeSec,
word  boardTimeMs,
dword  seqNo 
) [protected]

Sets the message's timestamp according to the UDP timing data supplied.

As this member is intended to be called from a constructor of a derived class, logic_errror is thrown, if the message's timestamp already was valid.

template<class ContextT>
void stm::tools::BaseMessage< ContextT >::setFpgaTimestamp ( word  bfn,
byte  slot,
word  chip 
) [protected]

Sets the message's timestamp according to the FPGA timing data supplied.

As this member is intended to be called from a constructor of a derived class, logic_errror is thrown, if the message's timestamp already was valid.


© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).