sP2P c++ STL *nix API  1.2
NAT traversal and peer-to-peer networking API providing all utilities needed to build peer-to-peer application straigth out of box
 All Classes Functions Variables Typedefs Enumerations Enumerator
sp2plib::VObject Class Reference

Virtual object for index server store More...

#include <VObject.h>

Public Member Functions

 VObject ()
 Initializes new instance of VObject object
 
 ~VObject ()
 Destructor.
 
Guid UID ()
 Gets unique identifier of virtual object
 
int AllPropertiesCount ()
 Getas number of custom properties
 
::std::string PropertyNameOnIndex (int Index)
 Getas name of property on (name,vale) pair located at index postion
 
void RemoveProperty (std::string name)
 Removes property with name if exists
 
::std::string & operator[] (::std::string Name)
 Array indexer operator for getting/setting object properties.
 
::std::string getProperty (::std::string name)
 Gets property value by property name, value = getProperty("property_name") is equivalent to value = VObject["property_name"]
 
void setProperty (::std::string name,::std::string value)
 Sets property value, setProperty("property_name",value) is equivalent to VObject["property_name"] = value
 
int ParseFromBytes (unsigned char *buff, int startIndex=0)
 Initializes VObject object from byte array
 
sp2plib::UInt32 GetSerializationLength ()
 Gets number of bytes needed to store object
 
int WriteToByteArray (unsigned char *buff, int startIndex=0)
 Wrtites VObject object bytes to byte array
 
unsigned char * new_GetBytes (int *len)
 Gets VObject object bytes
 

Detailed Description

Virtual object for index server store

Constructor & Destructor Documentation

sp2plib::VObject::VObject ( )

Initializes new instance of VObject object

sp2plib::VObject::~VObject ( )

Destructor.

Member Function Documentation

int sp2plib::VObject::AllPropertiesCount ( )

Getas number of custom properties

::std::string sp2plib::VObject::getProperty ( ::std::string  name)

Gets property value by property name, value = getProperty("property_name") is equivalent to value = VObject["property_name"]

Parameters
nameProperty name
Returns
Property value
sp2plib::UInt32 sp2plib::VObject::GetSerializationLength ( )

Gets number of bytes needed to store object

Returns
Number of bytes
unsigned char* sp2plib::VObject::new_GetBytes ( int *  len)

Gets VObject object bytes

Parameters
lenInt variable to strore length value to</parm>
Returns
VObject object bytes
::std::string& sp2plib::VObject::operator[] ( ::std::string  Name)

Array indexer operator for getting/setting object properties.

Parameters
NameProperty name
int sp2plib::VObject::ParseFromBytes ( unsigned char *  buff,
int  startIndex = 0 
)

Initializes VObject object from byte array

Parameters
buffBuffer holding VObject bytes
startIndexStart index from whict to start parsing
Returns
Number of bytes parsed
::std::string sp2plib::VObject::PropertyNameOnIndex ( int  Index)

Getas name of property on (name,vale) pair located at index postion

void sp2plib::VObject::RemoveProperty ( std::string  name)

Removes property with name if exists

Parameters
nameProperty name
void sp2plib::VObject::setProperty ( ::std::string  name,
::std::string  value 
)

Sets property value, setProperty("property_name",value) is equivalent to VObject["property_name"] = value

Parameters
nameProperty name
valueProperty value
Guid sp2plib::VObject::UID ( )

Gets unique identifier of virtual object

Returns
VObject Uid
int sp2plib::VObject::WriteToByteArray ( unsigned char *  buff,
int  startIndex = 0 
)

Wrtites VObject object bytes to byte array

Parameters
buffBuffer to store VObject object to
startIndexStarting index from which to start writing
Returns
Number of butes writen

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