#include <secstwo_internal.hpp>
Public Types | |
typedef type_selector< _type > ::data_type | data_t |
typedef type_selector< _type > ::print_type | print_t |
typedef type_selector< _type > ::container_type | container_t |
Public Member Functions | |
msg_item_impl_t (const char *name) | |
msg_item_impl_t (const char *name, const container_t &data) | |
msg_item_impl_t (const msg_item_impl_t &oth) | |
virtual data_item_t & | operator[] (uint32_t ix) |
Array access operator by index There are two main cases for this operator: 1. Access to the element of a list data item 2. Access to the elements in a numeric item body If the index goes beyond the item size, the ref to the item itself is returned. One is strongly encouraged to use. | |
virtual | operator bool () const |
Boolean type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator int8_t () const |
Signed char type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator uint8_t () const |
Unsigned char type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator int16_t () const |
Signed short type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator uint16_t () const |
Unsigned short type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator int32_t () const |
Signed int type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator uint32_t () const |
Unsigned int type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator uint64_t () const |
Unsigned long type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator int64_t () const |
Signed long type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator float () const |
Float type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual | operator double () const |
Double type cast operator. Casts a data item to the given primary type. Any numeric data item can be casted to any numeric type. String data items and list data items return 0 (zero) if to attempt to cast to a numeric type Numeric and list types return an empty string if to attempt to cast to a string. | |
virtual data_item_t & | operator= (const bool &data) |
Boolean type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const uint8_t &data) |
Unsigned char type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const int8_t &data) |
Signed char type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const uint16_t &data) |
Unsigned short type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const int16_t &data) |
Signed short type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const uint32_t &data) |
Unsigned int type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const int32_t &data) |
Signed int type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const uint64_t &data) |
Unsigned long type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const int64_t &data) |
Signed long type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const double &data) |
Double type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator= (const float &data) |
Float type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value. | |
virtual data_item_t & | operator+= (const bool &data) |
virtual data_item_t & | operator+= (const uint8_t &data) |
virtual data_item_t & | operator+= (const int8_t &data) |
virtual data_item_t & | operator+= (const uint16_t &data) |
virtual data_item_t & | operator+= (const int16_t &data) |
virtual data_item_t & | operator+= (const uint32_t &data) |
virtual data_item_t & | operator+= (const int32_t &data) |
virtual data_item_t & | operator+= (const uint64_t &data) |
virtual data_item_t & | operator+= (const int64_t &data) |
virtual data_item_t & | operator+= (const double &data) |
virtual data_item_t & | operator+= (const float &data) |
data_t | get_curr_item () const |
virtual bool | operator== (const bool &v) const |
Boolean comparison operator. | |
virtual bool | operator== (const int8_t &v) const |
Signed char comparison operator. | |
virtual bool | operator== (const uint8_t &v) const |
Unsigned char comparison operator. | |
virtual bool | operator== (const int16_t &v) const |
Signed short comparison operator. | |
virtual bool | operator== (const uint16_t &v) const |
Unsigned short comparison operator. | |
virtual bool | operator== (const int32_t &v) const |
Signed int comparison operator. | |
virtual bool | operator== (const uint32_t &v) const |
Unsigned int comparison operator. | |
virtual bool | operator== (const int64_t &v) const |
Signed long comparison operator. | |
virtual bool | operator== (const uint64_t &v) const |
Unsigned long comparison operator. | |
virtual bool | operator== (const float &v) const |
Float comparison operator. | |
virtual bool | operator== (const double &v) const |
Double comparison operator. | |
virtual bool | match (const data_item_t &other, match_t match=ALL) const |
Function to match a given data item to another data item. | |
virtual data_type_t | type () const |
Returns data item type. | |
virtual size_t | size () const |
Returns number of elements. | |
virtual void | print (std::ostream &os, const char *prefix=NULL) const |
Prints the item in human-readable format. | |
const container_t & | container () const |
virtual size_t | raw_size () const |
Returns number of bytes the item occupies in binary format. | |
virtual int | copy_data (const data_item_t &o) |
Copies all data from the given item. Data copy is made if data items have same type. For list item copy data is made reqursively and does not stop upon unsuccesful data copy. | |
virtual pdata_item_t | clone () const |
Creates a copy of the message. Calls data item copy constructor and puts newly returned data item into a shared ptr. Contrary to cloning shared ptrs with ref count on a message is incremented, cloned message is a separate one and it's data can be edited with no impact to the nacestor data item. | |
virtual void | clear_data () |
Clears all data in a data item. | |
Protected Attributes | |
uint32_t | _access_index |
container_t | _data |
Friends | |
class | binary_deserializer_t |
class | xml_deserializer_t |
Definition at line 190 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator[] | ( | uint32_t | ix | ) | [inline, virtual] |
Array access operator by index There are two main cases for this operator: 1. Access to the element of a list data item 2. Access to the elements in a numeric item body If the index goes beyond the item size, the ref to the item itself is returned. One is strongly encouraged to use.
ix | access index |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 207 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const bool & | ) | [inline, virtual] |
Boolean type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 289 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const uint8_t & | ) | [inline, virtual] |
Unsigned char type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 295 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const int8_t & | ) | [inline, virtual] |
Signed char type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 301 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const uint16_t & | ) | [inline, virtual] |
Unsigned short type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 307 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const int16_t & | ) | [inline, virtual] |
Signed short type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 313 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const uint32_t & | ) | [inline, virtual] |
Unsigned int type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 319 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const int32_t & | ) | [inline, virtual] |
Signed int type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 325 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const uint64_t & | ) | [inline, virtual] |
Unsigned long type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 331 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const int64_t & | ) | [inline, virtual] |
Signed long type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 337 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const double & | ) | [inline, virtual] |
Double type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 343 of file secstwo_internal.hpp.
virtual data_item_t& freesecs::secstwo::msg_item_impl_t< _type >::operator= | ( | const float & | ) | [inline, virtual] |
Float type assignment operator It is possible to assign any numeric type to any numeric type. Assignment of a numeric type to a string or list type takes no effect. Old data is overwritten by this operator, i.e. if there were an array of data, operator cleans it up and pushes back the new value.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 349 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const bool & | ) | const [inline, virtual] |
Boolean comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 416 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const int8_t & | ) | const [inline, virtual] |
Signed char comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 420 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const uint8_t & | ) | const [inline, virtual] |
Unsigned char comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 424 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const int16_t & | ) | const [inline, virtual] |
Signed short comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 428 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const uint16_t & | ) | const [inline, virtual] |
Unsigned short comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 432 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const int32_t & | ) | const [inline, virtual] |
Signed int comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 436 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const uint32_t & | ) | const [inline, virtual] |
Unsigned int comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 440 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const int64_t & | ) | const [inline, virtual] |
Signed long comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 444 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const uint64_t & | ) | const [inline, virtual] |
Unsigned long comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 448 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const float & | ) | const [inline, virtual] |
Float comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 452 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== | ( | const double & | ) | const [inline, virtual] |
Double comparison operator.
true | Comparison successful | |
false | Comparison unsuccessful - either data or structure (for lists) or type do not match |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 456 of file secstwo_internal.hpp.
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::match | ( | const data_item_t & | it, | |
match_t | match = ALL | |||
) | const [inline, virtual] |
Function to match a given data item to another data item.
it | Item to match. | |
match | Token of kind of match. |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 460 of file secstwo_internal.hpp.
References freesecs::secstwo::msg_item_impl_t< _type >::_data, and freesecs::secstwo::data_item_t::type().
virtual data_type_t freesecs::secstwo::msg_item_impl_t< _type >::type | ( | ) | const [inline, virtual] |
Returns data item type.
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 481 of file secstwo_internal.hpp.
Referenced by freesecs::secstwo::msg_item_impl_t< _type >::print().
virtual int freesecs::secstwo::msg_item_impl_t< _type >::copy_data | ( | const data_item_t & | ) | [inline, virtual] |
Copies all data from the given item. Data copy is made if data items have same type. For list item copy data is made reqursively and does not stop upon unsuccesful data copy.
0 | Data copy successful | |
< | 0 Data copy performed with errors |
Reimplemented from freesecs::secstwo::data_item_t.
Definition at line 524 of file secstwo_internal.hpp.
References freesecs::secstwo::msg_item_impl_t< _type >::_data, and freesecs::secstwo::data_item_t::type().