freesecs::secstwo::list_item_t Class Reference

Implementation for list data type Operator item["sub-item name"] returns the item by name or this if not found. Operator item[int index] returns the item by indexif it's withinthe bounds or this index is out of bounds. More...

#include <secstwo_internal.hpp>

Inheritance diagram for freesecs::secstwo::list_item_t:

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

Collaboration graph
[legend]

List of all members.

Public Types

typedef type_selector
< e_list_t >::data_type 
data_t
typedef type_selector
< e_list_t >::print_type 
print_t
typedef type_selector
< e_list_t >::container_type 
container_t

Public Member Functions

 list_item_t (const char *name)
virtual data_type_t type () const
 Returns data item type.
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 *key)
 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.
data_item_toperator+= (const pdata_item_t &pit)
virtual uint32_t size () const
 Size calc function override for list. As per SEMI E5, section 9.3, the list size is counted by the number of elements, not by the number of bytes.
virtual bool variable () const
virtual void print (std::ostream &os, const char *prefix) const
 Prints the item in human-readable format.
virtual size_t raw_size () const
 Returns number of bytes the item occupies in binary format.
virtual bool match (const data_item_t &other, match_t kind=ALL) const
 Function to match a given data item to another data item.
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.
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.

Protected Attributes

container_t _data

Friends

class binary_deserializer_t
class xml_deserializer_t
class binary_serializer_t
class xml_serializer_t

Classes

struct  match_name


Detailed Description

Implementation for list data type Operator item["sub-item name"] returns the item by name or this if not found. Operator item[int index] returns the item by indexif it's withinthe bounds or this index is out of bounds.

Definition at line 559 of file secstwo_internal.hpp.


Member Function Documentation

virtual data_type_t freesecs::secstwo::list_item_t::type (  )  const [inline, virtual]

Returns data item type.

See also:
data_type_t

Reimplemented from freesecs::secstwo::data_item_t.

Definition at line 570 of file secstwo_internal.hpp.

Referenced by match().

Here is the caller graph for this function:

virtual data_item_t& freesecs::secstwo::list_item_t::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.

Reimplemented in freesecs::secstwo::var_list_item_t.

Definition at line 571 of file secstwo_internal.hpp.

Referenced by freesecs::secstwo::var_list_item_t::operator[]().

Here is the caller graph for this function:

virtual data_item_t& freesecs::secstwo::list_item_t::operator[] ( const char *  name  )  [inline, 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 from freesecs::secstwo::data_item_t.

Definition at line 580 of file secstwo_internal.hpp.

virtual bool freesecs::secstwo::list_item_t::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.

Reimplemented in freesecs::secstwo::var_list_item_t.

Definition at line 647 of file secstwo_internal.hpp.

References _data, type(), and freesecs::secstwo::data_item_t::type().

Referenced by freesecs::secstwo::var_list_item_t::match().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual int freesecs::secstwo::list_item_t::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.

Reimplemented in freesecs::secstwo::var_list_item_t.

Definition at line 695 of file secstwo_internal.hpp.

References _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:05 2010 for FREESECS secstwo by  doxygen 1.5.6