Defines PeerHood's service class.
Public Methods
-
CService(const CService& aOriginal)
- Copy constructor.
-
CService(const char* aData)
- Constructor that creates the object from the given marshalled data.
-
CService(const char* aData, int aPid)
- Constructor that creates the object from the given marshalled data.
-
CService(const char* aData, const string& aPrototype)
- Constructor that creates the object from the given marshalled data.
-
const string& GetAttributeString()
- Returns service's attributes.
-
bool GetAttribute(string& aAttribute)
- Returns the value of one attribute.
-
const string& GetName()
- Returns service's name.
-
char* MarshallL(int* aLength)
- Converts service's information to an octet stream.
-
int MarshalledLength()
- Returns the number of octets needed to marshall the service.
-
int GetPid()
- Returns the process id of the parent library
-
unsigned short GetPort()
- Returns the port of service's listening connection.
Documentation
Defines PeerHood's service class. In the PeerHood system, each service
is presented as an instance of this class.
CService(const CService& aOriginal)
-
Copy constructor. Creates an exact copy of the original object.
- Parameters:
- aOriginal - The original object to be copied.
- Returns:
- none
CService(const char* aData)
-
Constructor that creates the object from the given marshalled data.
- Parameters:
- aData - Marshalled data to be encoded. This parameter cannot be NULL.
- Returns:
- none
CService(const char* aData, int aPid)
-
Constructor that creates the object from the given marshalled data.
- Parameters:
- aData - Marshalled data to be encoded. This parameter cannot be NULL.
- Returns:
- none
CService(const char* aData, const string& aPrototype)
-
Constructor that creates the object from the given marshalled data.
In addition, the service's connection prototype is set.
- Parameters:
- aData - Marshalled data to be encoded. This parameter cannot be NULL.
aPrototype - Service's connection prototype.
- Returns:
- none
const string& GetAttributeString()
-
Returns service's attributes. The format is "key value", with space
between each key-value pair.
- Returns:
- service's attribute string
bool GetAttribute(string& aAttribute)
-
Returns the value of one attribute. If the given attribute is found
then its value is inserted to the first parameter. Otherwise the parameter
is left intact.
- Parameters:
- aAttribute - The asked attribute. If the asked attribute is found then
it is inserted into this parameter upon return.
- Returns:
- true if the given attribute was found
const string& GetName()
-
Returns service's name. Each service should have a unique name. If two
services with the same name exist then the behavior is undefined.
- Returns:
- service's name
char* MarshallL(int* aLength)
-
Converts service's information to an octet stream. Note that memory
allocated for the return value must be freed by the caller. The format of
the returned stream is defined in the TServiceData structure.
- Parameters:
- aLength - Integer that on return will hold the length of the created
octet stream.
- Returns:
- octet presentation of the service's information
int MarshalledLength()
-
Returns the number of octets needed to marshall the service.
- Returns:
- the number of octets required to marshall the service
int GetPid()
-
Returns the process id of the parent library. On the remote side this
function always returns -1.
- Returns:
- the process id of the parent application
unsigned short GetPort()
-
Returns the port of service's listening connection.
- Returns:
- the port of service's listening connection
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.