freesecs::secstwo::msg_t Class Reference

SECSII message declaration. More...

#include <secstwomsg.h>

Inheritance diagram for freesecs::secstwo::msg_t:

Inheritance graph
[legend]
Collaboration diagram for freesecs::secstwo::msg_t:

Collaboration graph
[legend]

List of all members.

Public Member Functions

data_item_toperator[] (uint32_t ix)
 SECSII message contents access by index.
data_item_toperator[] (const char *name)
 SECSII message contents access by symbolic name.
void print (std::ostream &os, const char *prefix=NULL) const
 Print SECSII message contents to C++ output stream.
bool operator== (const msg_t &) const
 SECSII message comparison operator. Compared are structure and data.
bool operator!= (const msg_t &) const
bool match (const msg_t &m, match_t match=ALL) const
 Function to match given SECSII message to another one.
int copy_data (const msg_t &)
 Copies all data from the given message. Data copy is made from originator's root data item to destinee's root data item.
msg_toperator= (const msg_t &)
 Data assignment operator If messages match, copy all data from one to another.
pmsg_t clone () const
 Clones the message. Creates a complete copy of the given message. Intend is the use case: There's a DB of messages a connection knows and accepts for reception. When the message comes, it is checked across the dictionary for the matching one. If the matching message is found and cloned and data is copied from incoming message to the cloned one After that, the incoming message is discarded and the cloned is used instead. As the cloned message has symbolic names assigned to it's data elements, it's easier to access them while treating incoming data.
void clear_data ()
 Clears all the data in the message.

Public Attributes

const std::string name
 SECSII message symbolic name.
const unsigned short stream
 SECSII message stream ID.
const unsigned short function
 SECSII message function ID.
unsigned char wbit
 SECSII message wait bit (reply required).
unsigned int sysbytes
 SECSII message sysbytes (transaction ID).

Protected Member Functions

 msg_t (const char *n, unsigned short s, unsigned short f)
 Message ctor - used by de-serializers.

Protected Attributes

pdata_item_t _pitem
 Root data element of the message.

Friends

class binary_deserializer_t
class binary_serializer_t
class xml_deserializer_t
class xml_serializer_t


Detailed Description

SECSII message declaration.

Definition at line 540 of file secstwomsg.h.


Member Function Documentation

data_item_t & msg_t::operator[] ( uint32_t  ix  ) 

SECSII message contents access by index.

Parameters:
ix Access index If index eq 0, SECSII message root element ref is returned If index neq 0, the operator recursively applied to the contents of the message root element
Returns:
Ref to data item
Return values:
SECSII message root element if index was 0 or if failed to complete the request

Definition at line 410 of file secstwomsg.cpp.

References _pitem.

data_item_t & msg_t::operator[] ( const char *  name  ) 

SECSII message contents access by symbolic name.

Parameters:
name Data item symbolic name First the mane of the msg root element is checked, then operator recursively applied to the contents of the root element of the message
Returns:
Ref to data item
Return values:
SECSII message root element if the name matches root element name or if failed to complete the request

Definition at line 420 of file secstwomsg.cpp.

References _pitem.

void msg_t::print ( std::ostream &  os,
const char *  prefix = NULL 
) const

Print SECSII message contents to C++ output stream.

Parameters:
os C++ output stream base class
prefix C-string (not null-terminated) that prepends each line output

Definition at line 430 of file secstwomsg.cpp.

References _pitem, function, name, stream, sysbytes, and wbit.

bool msg_t::match ( const msg_t m,
match_t  match = ALL 
) const

Function to match given SECSII message to another one.

Parameters:
m SECSII message to match.
match Token of kind of match.
See also:
match_t

Definition at line 446 of file secstwomsg.cpp.

References _pitem, function, and stream.

Referenced by operator==().

Here is the caller graph for this function:

int msg_t::copy_data ( const msg_t o  ) 

Copies all data from the given message. Data copy is made from originator's root data item to destinee's root data item.

Returns:
Data copy result.
Return values:
0 Data copy successful
< 0 Data copy performed with errors

Definition at line 495 of file secstwomsg.cpp.

References _pitem.


The documentation for this class was generated from the following files:

Generated on Sun Jun 20 08:10:10 2010 for FREESECS secstwo by  doxygen 1.5.6