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

Virtual user object More...

#include <VUser.h>

Public Member Functions

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

Public Attributes

std::list< GuidNetworkUIDS
 Gets list of virtual network UIDs virtual user belongs to
 
std::list< GuidPeerUIDS
 Gets list of UIDs of Peers currently bound to virtual user object. Note that multiple peers object can autentificate virtual user object and also one peer can autentificate multiple virtual user objects
 

Detailed Description

Virtual user object

Constructor & Destructor Documentation

sp2plib::VUser::VUser ( )

Initializes new instance of VUser object

sp2plib::VUser::~VUser ( )

Destructor.

Member Function Documentation

int sp2plib::VUser::AllPropertiesCount ( )

Getas number of custom properties

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

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

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

Gets number of bytes needed to store object

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

Gets VUser object bytes

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

Array indexer operator for getting/setting object properties.

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

Initializes VUser object from byte array

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

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

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

Removes property with name if exists

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

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

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

Gets unique identifier of virtual user object

Returns
VUser Uid
std::string sp2plib::VUser::Username ( )

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

Returns
Username
void sp2plib::VUser::Username ( std::string  value)

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

Parameters
valueUsername
int sp2plib::VUser::WriteToByteArray ( unsigned char *  buff,
int  startIndex = 0 
)

Wrtites VUser object bytes to byte array

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

Member Data Documentation

std::list<Guid> sp2plib::VUser::NetworkUIDS

Gets list of virtual network UIDs virtual user belongs to

std::list<Guid> sp2plib::VUser::PeerUIDS

Gets list of UIDs of Peers currently bound to virtual user object. Note that multiple peers object can autentificate virtual user object and also one peer can autentificate multiple virtual user objects


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