xorp

XrlArgs Class Reference

List of all members.

Classes

struct  BadArgs
class  XrlAtomFound
class  XrlAtomNotFound

Public Types

typedef vector< XrlAtomATOMS
typedef ATOMS::const_iterator const_iterator
typedef ATOMS::iterator iterator

Public Member Functions

 XrlArgs (const char *str) throw (InvalidString)
XrlArgsadd (const XrlAtom &xa) throw (XrlAtomFound)
const XrlAtomget (const XrlAtom &dataless) const throw (XrlAtomNotFound)
const XrlAtomget (unsigned idx, const char *name) const throw (XrlAtomNotFound)
void remove (const XrlAtom &dataless) throw (XrlAtomNotFound)
XrlArgsadd_bool (const char *name, bool val) throw (XrlAtomFound)
const bool_t & get_bool (const char *name) const throw (BadArgs)
void remove_bool (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, bool v) throw (XrlAtomFound)
void get (const char *n, bool &t) const throw (BadArgs)
XrlArgsadd_int32 (const char *name, int32_t val) throw (XrlAtomFound)
const int32_t & get_int32 (const char *name) const throw (BadArgs)
void remove_int32 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, int32_t v) throw (XrlAtomFound)
void get (const char *n, int32_t &t) const throw (BadArgs)
XrlArgsadd_uint32 (const char *name, uint32_t v) throw (XrlAtomFound)
const uint32_t & get_uint32 (const char *name) const throw (BadArgs)
void remove_uint32 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, uint32_t v) throw (XrlAtomFound)
void get (const char *n, uint32_t &t) const throw (BadArgs)
XrlArgsadd_ipv4 (const char *n, const IPv4 &a) throw (XrlAtomFound)
const IPv4get_ipv4 (const char *name) const throw (BadArgs)
void remove_ipv4 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const IPv4 &a) throw (XrlAtomFound)
void get (const char *n, IPv4 &a) const throw (BadArgs)
XrlArgsadd_ipv4net (const char *n, const IPv4Net &a) throw (XrlAtomFound)
const IPv4Netget_ipv4net (const char *name) const throw (BadArgs)
void remove_ipv4net (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const IPv4Net &v) throw (XrlAtomFound)
void get (const char *n, IPv4Net &t) const throw (BadArgs)
XrlArgsadd_ipv6 (const char *name, const IPv6 &addr) throw (XrlAtomFound)
const IPv6get_ipv6 (const char *name) const throw (BadArgs)
void remove_ipv6 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const IPv6 &a) throw (XrlAtomFound)
void get (const char *n, IPv6 &a) const throw (BadArgs)
XrlArgsadd_ipv6net (const char *name, const IPv6Net &addr) throw (XrlAtomFound)
const IPv6Netget_ipv6net (const char *name) const throw (BadArgs)
void remove_ipv6net (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const IPv6Net &a) throw (XrlAtomFound)
void get (const char *n, IPv6Net &a) const throw (BadArgs)
XrlArgsadd_ipvx (const char *name, const IPvX &ipvx) throw (XrlAtomFound)
const IPvX get_ipvx (const char *name) const throw (BadArgs)
void remove_ipvx (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const IPvX &a) throw (XrlAtomFound)
void get (const char *n, IPvX &a) const throw (BadArgs)
XrlArgsadd_ipvxnet (const char *name, const IPvXNet &ipvxnet) throw (XrlAtomFound)
const IPvXNet get_ipvxnet (const char *name) const throw (BadArgs)
void remove_ipvxnet (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const IPvXNet &a) throw (XrlAtomFound)
void get (const char *n, IPvXNet &a) const throw (BadArgs)
XrlArgsadd_mac (const char *name, const Mac &addr) throw (XrlAtomFound)
const Macget_mac (const char *name) const throw (BadArgs)
void remove_mac (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const Mac &a) throw (XrlAtomFound)
void get (const char *n, Mac &a) const throw (BadArgs)
XrlArgsadd_string (const char *name, const string &addr) throw (XrlAtomFound)
const string & get_string (const char *name) const throw (BadArgs)
void remove_string (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const string &a) throw (XrlAtomFound)
void get (const char *n, string &a) const throw (BadArgs)
XrlArgsadd_list (const char *name, const XrlAtomList &addr) throw (XrlAtomFound)
const XrlAtomListget_list (const char *name) const throw (BadArgs)
void remove_list (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const XrlAtomList &a) throw (XrlAtomFound)
void get (const char *n, XrlAtomList &a) const throw (BadArgs)
XrlArgsadd_binary (const char *name, const vector< uint8_t > &addr) throw (XrlAtomFound)
const vector< uint8_t > & get_binary (const char *name) const throw (BadArgs)
void remove_binary (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, const vector< uint8_t > &a) throw (XrlAtomFound)
void get (const char *n, vector< uint8_t > &a) const throw (BadArgs)
XrlArgsadd_int64 (const char *name, int64_t v) throw (XrlAtomFound)
const int64_t & get_int64 (const char *name) const throw (BadArgs)
void remove_int64 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, int64_t v) throw (XrlAtomFound)
void get (const char *n, int64_t &t) const throw (BadArgs)
XrlArgsadd_uint64 (const char *name, uint64_t v) throw (XrlAtomFound)
const uint64_t & get_uint64 (const char *name) const throw (BadArgs)
void remove_uint64 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, uint64_t v) throw (XrlAtomFound)
void get (const char *n, uint64_t &t) const throw (BadArgs)
XrlArgsadd_fp64 (const char *name, fp64_t v) throw (XrlAtomFound)
const fp64_t & get_fp64 (const char *name) const throw (BadArgs)
void remove_fp64 (const char *name) throw (XrlAtomNotFound)
XrlArgsadd (const char *n, fp64_t v) throw (XrlAtomFound)
void get (const char *n, fp64_t &t) const throw (BadArgs)
XrlArgsadd (const XrlArgs &args) throw (XrlAtomFound)
bool matches_template (XrlArgs &t) const
bool operator== (const XrlArgs &t) const
size_t size () const
const XrlAtomoperator[] (uint32_t index) const
const XrlAtomitem (uint32_t index) const
const XrlAtomoperator[] (const string &name) const throw (XrlAtomNotFound)
const XrlAtomitem (const string &name) const throw (XrlAtomNotFound)
void push_back (const XrlAtom &xa)
const XrlAtomback () throw (XrlAtomNotFound)
void pop_back () throw (XrlAtomNotFound)
const_iterator begin () const
const_iterator end () const
void clear ()
bool empty ()
void swap (XrlArgs &xa)
size_t packed_bytes (XrlAtom *head=NULL) const
 Get number of bytes needed to pack atoms contained within instance.
size_t pack (uint8_t *buffer, size_t buffer_bytes, XrlAtom *head=NULL) const
 Pack contained atoms into a byte array.
size_t unpack (const uint8_t *buffer, size_t buffer_bytes, XrlAtom *head=NULL)
 Unpack atoms from byte array into instance.
size_t fill (const uint8_t *buffer, size_t buffer_bytes)
string str () const
template<class T >
void set_arg (int idx, const T &arg)

Static Public Member Functions

static size_t unpack_header (uint32_t &cnt, const uint8_t *in, size_t len)

Protected Member Functions

void check_not_found (const XrlAtom &xa) throw (XrlAtomFound)

Protected Attributes

ATOMS _args
bool _have_name

Member Function Documentation

size_t XrlArgs::pack ( uint8_t *  buffer,
size_t  buffer_bytes,
XrlAtom head = NULL 
) const

Pack contained atoms into a byte array.

The size of the byte array should be larger or equal to the value returned by packed_bytes().

Parameters:
bufferbuffer to receive data.
buffer_bytessize of buffer.
Returns:
size of packed data on success, 0 on failure.
size_t XrlArgs::unpack ( const uint8_t *  buffer,
size_t  buffer_bytes,
XrlAtom head = NULL 
)

Unpack atoms from byte array into instance.

The atoms are appended to the list of atoms associated with instance.

Parameters:
bufferto read data from.
buffer_bytessize of buffer. The size should exactly match number of bytes of packed atoms, ie packed_bytes() value used when packing.
Returns:
number of bytes turned into atoms on success, 0 on failure.

The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations