freesecs::secstwo::data_item_t Class Reference

SEMI E5 Data item base class. More...

#include <secstwomsg.h>

Inheritance diagram for freesecs::secstwo::data_item_t:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 data_item_t (const char *name)
virtual ~data_item_t ()
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 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 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 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 operator std::string () const
 String 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_toperator[] (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 data_item_toperator[] (const char *name)
 Array access operator by name (the one given to the item upon construction) This works only for list data item and call pull up the result from any indentation level, ex. the list contains another list containing named item.
virtual bool match (const data_item_t &it, match_t match=ALL) const
 Function to match a given data item to another data item.
virtual bool operator== (const data_item_t &) const
 Data item comparison operator.
virtual bool operator== (const bool &) const
 Boolean comparison operator.
virtual bool operator== (const int8_t &) const
 Signed char comparison operator.
virtual bool operator== (const uint8_t &) const
 Unsigned char comparison operator.
virtual bool operator== (const int16_t &) const
 Signed short comparison operator.
virtual bool operator== (const uint16_t &) const
 Unsigned short comparison operator.
virtual bool operator== (const int32_t &) const
 Signed int comparison operator.
virtual bool operator== (const uint32_t &) const
 Unsigned int comparison operator.
virtual bool operator== (const int64_t &) const
 Signed long comparison operator.
virtual bool operator== (const uint64_t &) const
 Unsigned long comparison operator.
virtual bool operator== (const float &) const
 Float comparison operator.
virtual bool operator== (const double &) const
 Double comparison operator.
virtual bool operator== (const std::string &) const
 String comparison operator.
bool operator!= (const data_item_t &) const
bool operator!= (const bool &) const
bool operator!= (const int8_t &) const
bool operator!= (const uint8_t &) const
bool operator!= (const int16_t &) const
bool operator!= (const uint16_t &) const
bool operator!= (const int32_t &) const
bool operator!= (const uint32_t &) const
bool operator!= (const int64_t &) const
bool operator!= (const uint64_t &) const
bool operator!= (const float &) const
bool operator!= (const double &) const
bool operator!= (const std::string &) const
virtual pdata_item_t clone () const =0
 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 ()=0
 Clears all data in a data item.
virtual data_item_toperator= (const bool &)
 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_toperator= (const uint8_t &)
 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_toperator= (const int8_t &)
 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_toperator= (const uint16_t &)
 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_toperator= (const int16_t &)
 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_toperator= (const uint32_t &)
 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_toperator= (const int32_t &)
 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_toperator= (const uint64_t &)
 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_toperator= (const int64_t &)
 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_toperator= (const float &)
 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_toperator= (const double &)
 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_toperator= (const char *)
 String 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_toperator= (const std::string &)
 String 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_toperator+= (const pdata_item_t &)
virtual data_item_toperator+= (const bool &)
virtual data_item_toperator+= (const uint8_t &)
virtual data_item_toperator+= (const int8_t &)
virtual data_item_toperator+= (const uint16_t &)
virtual data_item_toperator+= (const int16_t &)
virtual data_item_toperator+= (const uint32_t &)
virtual data_item_toperator+= (const int32_t &)
virtual data_item_toperator+= (const uint64_t &)
virtual data_item_toperator+= (const int64_t &)
virtual data_item_toperator+= (const float &)
virtual data_item_toperator+= (const double &)
virtual data_item_toperator+= (const char *)
virtual data_item_toperator+= (const std::string &)
virtual size_t size () const
 Returns number of elements.
virtual data_type_t type () const
 Returns data item type.
const char * name () const
 Returns data item symbolic name.
virtual void print (std::ostream &, const char *prefix=NULL) const =0
 Prints the item in human-readable format.
virtual size_t raw_size () const =0
 Returns number of bytes the item occupies in binary format.
virtual int copy_data (const data_item_t &)
 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.


Detailed Description

SEMI E5 Data item base class.

Definition at line 94 of file secstwomsg.h.


Constructor & Destructor Documentation

data_item_t::data_item_t ( const char *  name  ) 

item ctor

Parameters:
name Name of the item (defined in SEMI E5 #9.6 ).

Definition at line 27 of file secstwomsg.cpp.

data_item_t::~data_item_t (  )  [virtual]

item dtor

Definition at line 34 of file secstwomsg.cpp.


Member Function Documentation

data_item_t & data_item_t::operator[] ( uint32_t  ix  )  [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.

See also:
length method prior to calling this operator
Parameters:
ix access index
Returns:
Ref to the item found or ref to the item itself if failure.

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >, freesecs::secstwo::list_item_t, and freesecs::secstwo::var_list_item_t.

Definition at line 91 of file secstwomsg.cpp.

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

Array access operator by name (the one given to the item upon construction) This works only for list data item and call pull up the result from any indentation level, ex. the list contains another list containing named item.

Parameters:
name Name of the wanted item.
Returns:
Ref to the item found or ref to the item itself if failure.

Reimplemented in freesecs::secstwo::list_item_t.

Definition at line 97 of file secstwomsg.cpp.

bool data_item_t::match ( const data_item_t it,
match_t  match = ALL 
) const [virtual]

Function to match a given data item to another data item.

Parameters:
it Item to match.
match Token of kind of match.
See also:
match_t

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >, freesecs::secstwo::list_item_t, freesecs::secstwo::var_list_item_t, and freesecs::secstwo::string_data_item_t< _type >.

Definition at line 251 of file secstwomsg.cpp.

Referenced by operator==().

Here is the caller graph for this function:

bool data_item_t::operator== ( const data_item_t other  )  const [virtual]

Data item comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Definition at line 240 of file secstwomsg.cpp.

References match().

Here is the call graph for this function:

bool data_item_t::operator== ( const bool &   )  const [virtual]

Boolean comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 120 of file secstwomsg.cpp.

bool data_item_t::operator== ( const int8_t &   )  const [virtual]

Signed char comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 125 of file secstwomsg.cpp.

bool data_item_t::operator== ( const uint8_t &   )  const [virtual]

Unsigned char comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 130 of file secstwomsg.cpp.

bool data_item_t::operator== ( const int16_t &   )  const [virtual]

Signed short comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 135 of file secstwomsg.cpp.

bool data_item_t::operator== ( const uint16_t &   )  const [virtual]

Unsigned short comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 140 of file secstwomsg.cpp.

bool data_item_t::operator== ( const int32_t &   )  const [virtual]

Signed int comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 145 of file secstwomsg.cpp.

bool data_item_t::operator== ( const uint32_t &   )  const [virtual]

Unsigned int comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 150 of file secstwomsg.cpp.

bool data_item_t::operator== ( const int64_t &   )  const [virtual]

Signed long comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 155 of file secstwomsg.cpp.

bool data_item_t::operator== ( const uint64_t &   )  const [virtual]

Unsigned long comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 160 of file secstwomsg.cpp.

bool data_item_t::operator== ( const float &   )  const [virtual]

Float comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 165 of file secstwomsg.cpp.

bool data_item_t::operator== ( const double &   )  const [virtual]

Double comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 170 of file secstwomsg.cpp.

bool data_item_t::operator== ( const std::string &   )  const [virtual]

String comparison operator.

Returns:
Result of comparison operation
Return values:
true Comparison successful
false Comparison unsuccessful - either data or structure (for lists) or type do not match

Reimplemented in freesecs::secstwo::string_data_item_t< _type >.

Definition at line 175 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const bool &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 257 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const uint8_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 262 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const int8_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 267 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const uint16_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 272 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const int16_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 277 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const uint32_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 282 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const int32_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 287 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const uint64_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 292 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const int64_t &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 297 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const float &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 302 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const double &   )  [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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >.

Definition at line 307 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const char *   )  [virtual]

String 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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::string_data_item_t< _type >.

Definition at line 312 of file secstwomsg.cpp.

data_item_t & data_item_t::operator= ( const std::string &   )  [virtual]

String 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.

Returns:
Reference to self

Reimplemented in freesecs::secstwo::string_data_item_t< _type >.

Definition at line 317 of file secstwomsg.cpp.

data_type_t data_item_t::type (  )  const [virtual]

int data_item_t::copy_data ( const data_item_t  )  [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.

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

Reimplemented in freesecs::secstwo::msg_item_impl_t< _type >, freesecs::secstwo::list_item_t, freesecs::secstwo::var_list_item_t, and freesecs::secstwo::string_data_item_t< _type >.

Definition at line 392 of file secstwomsg.cpp.


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