Library: Foundation
Package: Dynamic
Header: Poco/Dynamic/Struct.h
Member Functions: begin, contains, empty, end, erase, find, insert, members, operator [], size, toString
typedef typename Data::const_iterator ConstIterator;
typedef typename std::map < K, Var > Data;
typedef typename std::pair < typename Struct < K >::Iterator, bool > InsRetVal;
typedef typename Data::iterator Iterator;
typedef typename std::set < K > NameSet;
typedef typename Poco::SharedPtr < Struct < K > > Ptr;
typedef typename Struct < K >::Data::size_type SizeType;
typedef typename Struct < K >::Data::value_type ValueType;
Struct();
Creates an empty Struct
Creates the Struct from the given value.
template < typename T > Struct(
const std::map < K, T > & val
);
virtual ~Struct();
Destroys the Struct.
inline Iterator begin();
Returns the begin iterator for the Struct
inline ConstIterator begin() const;
Returns the begin const iterator for the Struct
inline bool contains(
const K & name
) const;
Returns true if the Struct contains a member with the given name
inline bool empty() const;
Returns true if the Struct doesn't contain any members
inline Iterator end();
Returns the end iterator for the Struct
inline ConstIterator end() const;
Returns the end const iterator for the Struct
inline SizeType erase(
const K & key
);
Erases the element if found, returns number of elements deleted
inline void erase(
Iterator & it
);
Erases the element at the given position
inline Iterator find(
const K & name
);
Returns an iterator, pointing to the <name,Var> pair containing the element, or it returns end() if the member was not found
inline ConstIterator find(
const K & name
) const;
Returns a const iterator, pointing to the <name,Var> pair containing the element, or it returns end() if the member was not found
template < typename T > inline InsRetVal insert(
const K & key,
const T & value
);
Inserts a <name, Var> pair into the Struct, returns a pair containing the iterator and a boolean which indicates success or not (is true, when insert succeeded, false, when already another element was present, in this case Iterator points to that other element)
inline InsRetVal insert(
const ValueType & aPair
);
Inserts a <name, Var> pair into the Struct, returns a pair containing the iterator and a boolean which indicates success or not (is true, when insert succeeded, false, when already another element was present, in this case Iterator points to that other element)
inline NameSet members() const;
Returns a sorted collection containing all member names
inline Var & operator[] (
const K & name
);
Returns the Var with the given name, creates an entry if not found.
const Var & operator[] (
const K & name
) const;
Returns the Var with the given name, throws a NotFoundException if the data member is not found.
SizeType size() const;
Returns the number of members the Struct contains
std::string toString();