Home Libraries Author Links

stm::tools::PrintkBinMessage< ContextT > Class Template Reference
[PrintkBinMsg: PrintkBin Message Model]

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

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

Collaboration graph
[legend]

List of all members.


Detailed Description

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

PrintkBin message scanning from a the BaseMessage's byte_iterator_range.

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 type PrintkBinMessage<ContextT> can be registered as BinMessage<ContextT> type known to that factory.

Definition at line 113 of file printkbinmsg.hpp.


Public Types

typedef ContextT context_type
 Context type of the messages to be scanned.
typedef BaseMessage< ContextT > basemessage_type
 Base type of this PrintkBinMessage.

Public Member Functions

 PrintkBinMessage (const byte *first, const byte *last, context_type &context, dword flags=basemessage_type::NoFlags) throw (std::exception)
 Construct a PrintkBinMessage object from the range [first, last) read from context.
const std::string & type () const
 Return the message type string.

Static Public Member Functions

static const std::string & Type ()
 Return the static message type string.

Member Typedef Documentation

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

Context type of the messages to be scanned.

Reimplemented from stm::tools::BaseMessage< ContextT >.

Definition at line 122 of file printkbinmsg.hpp.

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

Base type of this PrintkBinMessage.

Reimplemented from stm::tools::BaseMessage< ContextT >.

Definition at line 125 of file printkbinmsg.hpp.


Constructor & Destructor Documentation

template<class ContextT>
stm::tools::PrintkBinMessage< ContextT >::PrintkBinMessage ( const byte *  first,
const byte *  last,
context_type context,
dword  flags = basemessage_type::NoFlags 
) throw (std::exception)

Construct a PrintkBinMessage object from the range [first, last) read from context.

If a PrintkBin message characterized by its preceding sync word and its 6 or 12 byte timestamp begins with first and fits completely into the range [first, last), the constructor succeeds. Then the method status() returns BaseMessage::NoError, the method begin() returns first, the method end() returns a byte pointer to the byte after the possibly padded end of the message and the method body() returns the byte range consisting of the message's body excluding any padding bytes.

Else if the flag bit BaseMessage::ThrowOnError is not set, status() returns BaseMessage::OutOfSync or BaseMessage::ConsistencyError, begin() returns first, end() returns a byte pointer to the next plausible begin of a PrintkBin message and body() returns the offended byte range which may be empty. If the flags bit BaseMessage::ThrowOnError is set, the construcor throws std::runtime_error in these cases.

On other errors the constructor throws std::logic_error, if one of the arguments supplied is wrong, or std::range_error, if a PrintkBin message potentially begins with first, but does not fit completely into the range [first, last).


Member Function Documentation

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

Return the message type string.

Implements the pure virtual method basemessage_type::type().

Implements stm::tools::BaseMessage< ContextT >.

template<class ContextT>
static const std::string& stm::tools::PrintkBinMessage< ContextT >::Type (  )  [static]

Return the static message type string.


© Copyright Tom Michaelis 2002-2007

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