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::VNetwork Class Reference

Virtual network object More...

#include <VNetwork.h>

Public Member Functions

 VNetwork ()
 Initializes new instance of VNetwork object
 
 ~VNetwork ()
 Destructor.
 
Guid UID ()
 Gets unique identifier of virtual network object
 
std::string Name ()
 Gets virtual network name, when stored it's represented like other custom properties with only difference it's required.
 
void Name (std::string value)
 Sets virtual network name, when stored it's represented like other custom properties with only difference it's required
 
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 = VNetwork["property_name"]
 
void setProperty (::std::string name,::std::string value)
 Sets property value, setProperty("property_name",value) is equivalent to VNetwork["property_name"] = value
 
int ParseFromBytes (unsigned char *buff, int startIndex=0)
 Initializes VNetwork object from byte array
 
sp2plib::UInt32 GetSerializationLength ()
 Gets number of bytes needed to store object
 
int WriteToByteArray (unsigned char *buff, int startIndex=0)
 Wrtites VNetwork object bytes to byte array
 
unsigned char * new_GetBytes (int *len)
 Gets VNetwork object bytes
 

Detailed Description

Virtual network object

Constructor & Destructor Documentation

sp2plib::VNetwork::VNetwork ( )

Initializes new instance of VNetwork object

sp2plib::VNetwork::~VNetwork ( )

Destructor.

Member Function Documentation

int sp2plib::VNetwork::AllPropertiesCount ( )

Getas number of custom properties

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

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

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

Gets number of bytes needed to store object

Returns
Number of bytes
std::string sp2plib::VNetwork::Name ( )

Gets virtual network name, when stored it's represented like other custom properties with only difference it's required.

Returns
Username
void sp2plib::VNetwork::Name ( std::string  value)

Sets virtual network name, when stored it's represented like other custom properties with only difference it's required

Parameters
valueUsername
unsigned char* sp2plib::VNetwork::new_GetBytes ( int *  len)

Gets VNetwork object bytes

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

Array indexer operator for getting/setting object properties.

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

Initializes VNetwork object from byte array

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

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

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

Removes property with name if exists

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

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

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

Gets unique identifier of virtual network object

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

Wrtites VNetwork object bytes to byte array

Parameters
buffBuffer to store VNetwork 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: