#include <secstwomsg.h>
Public Member Functions | |
data_item_t & | operator[] (uint32_t ix) |
SECSII message contents access by index. | |
data_item_t & | operator[] (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_t & | operator= (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 |
Definition at line 540 of file secstwomsg.h.
data_item_t & msg_t::operator[] | ( | uint32_t | ix | ) |
SECSII message contents access by index.
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 |
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.
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 |
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 |
bool msg_t::match | ( | const msg_t & | m, | |
match_t | match = ALL | |||
) | const |
Function to match given SECSII message to another one.
m | SECSII message to match. | |
match | Token of kind of match. |
Definition at line 446 of file secstwomsg.cpp.
References _pitem, function, and stream.
Referenced by operator==().
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.
0 | Data copy successful | |
< | 0 Data copy performed with errors |
Definition at line 495 of file secstwomsg.cpp.
References _pitem.