freesecs::secstwo::msg_item_impl_t< _type > Class Template Reference

Implementation for all simple datatypes Implements data array handling. Operator item["sub-item name"] returns *this for simple types. More...

#include <secstwo_internal.hpp>

Inheritance diagram for freesecs::secstwo::msg_item_impl_t< _type >:

Inheritance graph
[legend]
Collaboration diagram for freesecs::secstwo::msg_item_impl_t< _type >:

Collaboration graph
[legend]

List of all members.

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_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 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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator= (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_toperator+= (const bool &data)
virtual data_item_toperator+= (const uint8_t &data)
virtual data_item_toperator+= (const int8_t &data)
virtual data_item_toperator+= (const uint16_t &data)
virtual data_item_toperator+= (const int16_t &data)
virtual data_item_toperator+= (const uint32_t &data)
virtual data_item_toperator+= (const int32_t &data)
virtual data_item_toperator+= (const uint64_t &data)
virtual data_item_toperator+= (const int64_t &data)
virtual data_item_toperator+= (const double &data)
virtual data_item_toperator+= (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


Detailed Description

template<data_type_t _type>
class freesecs::secstwo::msg_item_impl_t< _type >

Implementation for all simple datatypes Implements data array handling. Operator item["sub-item name"] returns *this for simple types.

See also:
data_item_t

Definition at line 190 of file secstwo_internal.hpp.


Member Function Documentation

template<data_type_t _type>
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.

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 from freesecs::secstwo::data_item_t.

Definition at line 207 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 289 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 295 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 301 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 307 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 313 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 319 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 325 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 331 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 337 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 343 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

Returns:
Reference to self

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 349 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const bool &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 416 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const int8_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 420 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const uint8_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 424 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const int16_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 428 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const uint16_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 432 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const int32_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 436 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const uint32_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 440 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const int64_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 444 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const uint64_t &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 448 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const float &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 452 of file secstwo_internal.hpp.

template<data_type_t _type>
virtual bool freesecs::secstwo::msg_item_impl_t< _type >::operator== ( const double &   )  const [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 456 of file secstwo_internal.hpp.

template<data_type_t _type>
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.

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

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().

Here is the call graph for this function:

template<data_type_t _type>
virtual data_type_t freesecs::secstwo::msg_item_impl_t< _type >::type (  )  const [inline, virtual]

Returns data item type.

See also:
data_type_t

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().

Here is the caller graph for this function:

template<data_type_t _type>
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.

Returns:
Data copy result.
Return values:
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().

Here is the call graph for this function:


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

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