AmArg Class Reference

variable type argument for DynInvoke APIs More...

#include <AmArg.h>

Inheritance diagram for AmArg:
AmObject

Data Structures

struct  OutOfBoundsException
struct  TypeMismatchException

Public Types

enum  {
  Undef = 0, Int, Bool, Double,
  CStr, AObject, ADynInv, Blob,
  Array, Struct
}
typedef std::vector< AmArgValueArray
typedef std::map< std::string,
AmArg
ValueStruct

Public Member Functions

 AmArg (const AmArg &v)
 AmArg (const int &v)
 AmArg (const bool &v)
 AmArg (const double &v)
 AmArg (const char *v)
 AmArg (const string &v)
 AmArg (const ArgBlob v)
 AmArg (AmObject *v)
 AmArg (AmDynInvoke *v)
 AmArg (vector< std::string > &v)
 AmArg (const vector< int > &v)
 AmArg (const vector< double > &v)
 AmArg (std::map< std::string, std::string > &v)
 AmArg (std::map< std::string, AmArg > &v)
void assertArray ()
void assertArray () const
void assertStruct ()
void assertStruct () const
short getType () const
AmArgoperator= (const AmArg &rhs)
void setBorrowedPointer (AmObject *v)
int asInt () const
int asBool () const
double asDouble () const
const char * asCStr () const
AmObjectasObject () const
AmDynInvokeasDynInv () const
ArgBlobasBlob () const
ValueStruct * asStruct () const
vector< string > asStringVector () const
vector< int > asIntVector () const
vector< bool > asBoolVector () const
vector< double > asDoubleVector () const
vector< AmObject * > asAmObjectVector () const
vector< ArgBlobasArgBlobVector () const
void assertArray (size_t s)
void push (const AmArg &a)
void push (const string &key, const AmArg &val)
void pop (AmArg &a)
void pop_back (AmArg &a)
void pop_back ()
void concat (const AmArg &a)
const size_t size () const
AmArgget (size_t idx)
AmArgget (size_t idx) const
AmArgback ()
AmArgback () const
AmArgoperator[] (size_t idx)
AmArgoperator[] (size_t idx) const
AmArgoperator[] (int idx)
AmArgoperator[] (int idx) const
AmArgoperator[] (std::string key)
AmArgoperator[] (std::string key) const
AmArgoperator[] (const char *key)
AmArgoperator[] (const char *key) const
bool hasMember (const std::string &name) const
bool hasMember (const char *name) const
std::vector< std::string > enumerateKeys () const
ValueStruct::const_iterator begin () const
ValueStruct::const_iterator end () const
void erase (const char *name)
void erase (const std::string &name)
void assertArrayFmt (const char *format) const
void clear ()
const char * t2str (int type)

Static Public Member Functions

static string print (const AmArg &a)

Friends

bool operator== (const AmArg &lhs, const AmArg &rhs)
bool json2arg (std::istream &input, AmArg &res)

Detailed Description

variable type argument for DynInvoke APIs


Member Function Documentation

void AmArg::assertArrayFmt ( const char *  format  )  const

throws exception if arg array does not conform to spec i - int t - bool f - double s - cstr o - object d - dyninvoke b - blob a - array u - struct

e.g. "ssif" -> [cstr, cstr, int, double]

AmArg & AmArg::back (  ) 

throws OutOfBoundsException if array too small

AmArg & AmArg::back (  )  const

throws OutOfBoundsException if array too small

void AmArg::erase ( const char *  name  ) 

remove struct member

void AmArg::erase ( const std::string &  name  ) 

remove struct member

AmArg & AmArg::get ( size_t  idx  )  const

throws OutOfBoundsException if array too small

bool AmArg::hasMember ( const std::string &  name  )  const

Check for the existence of a struct member by name.

Referenced by JsonRpcServer::execRpc().

AmArg & AmArg::operator[] ( size_t  idx  )  const

throws OutOfBoundsException if array too small

AmArg & AmArg::operator[] ( int  idx  )  const

throws OutOfBoundsException if array too small

AmArg & AmArg::operator[] ( size_t  idx  ) 

resizes array if too small

AmArg & AmArg::operator[] ( int  idx  ) 

resizes array if too small


Friends And Related Function Documentation

bool json2arg ( std::istream &  input,
AmArg res 
) [friend]
Returns:
true on success

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