My Project
Public Member Functions | List of all members
NPLInterface::NPLObjectProxyT< T > Class Template Reference

NPL object proxy. More...

#include <NPLInterface.hpp>

Inheritance diagram for NPLInterface::NPLObjectProxyT< T >:

Public Member Functions

 NPLObjectProxyT (NPLObjectBase *pObject)
 
 operator double ()
 
void operator= (double value)
 
 operator bool ()
 
void operator= (bool value)
 
 operator const string & ()
 
bool operator== (const string &value)
 
bool operator== (const char *value)
 
void operator= (const std::string &value)
 
void operator= (const char *value)
 
NPLObjectProxyToperator[] (const string &sName)
 
NPLObjectProxyToperator[] (const char *sName)
 
NPLObjectProxyToperator[] (int nIndex)
 
NPLObjectProxyT GetField (const string &sName)
 
NPLObjectProxyT GetField (const char *sName)
 
void MakeNil ()
 
T::Iterator_Type begin ()
 
T::Iterator_Type end ()
 
T::IndexIterator_Type index_begin ()
 
T::IndexIterator_Type index_end ()
 
NPLObjectBase::NPLObjectType GetType ()
 get the type
 

Detailed Description

template<class T>
class NPLInterface::NPLObjectProxyT< T >

NPL object proxy.

This is both a smart pointer and accessors Example 1: Create NPLTable and serialize to string NPLObjectProxy msg; msg["nid"] = (double)10; msg["name"] = "value"; msg["tab"]["name1"] = "value1"; NPLHelper::SerializeNPLTableToString(NULL, msg, strOutput);

Example 2: deserialize NPLTable from string.

NPLObjectProxy tabMsg = NPLHelper::StringToNPLTable("{nid=10, name=\"value\", tab={name1=\"value1\"}}");
assert((double)tabMsg["nid"] == 10);
assert((tabMsg["name"]) == "value");
assert((tabMsg["tab"]["name1"]) == "value1");

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