class CService

Defines PeerHood's service class.

Public Methods

[more] CService(const CService& aOriginal)
Copy constructor.
[more] CService(const char* aData)
Constructor that creates the object from the given marshalled data.
[more] CService(const char* aData, int aPid)
Constructor that creates the object from the given marshalled data.
[more] CService(const char* aData, const string& aPrototype)
Constructor that creates the object from the given marshalled data.
[more]const string& GetAttributeString()
Returns service's attributes.
[more]bool GetAttribute(string& aAttribute)
Returns the value of one attribute.
[more]const string& GetName()
Returns service's name.
[more]char* MarshallL(int* aLength)
Converts service's information to an octet stream.
[more]int MarshalledLength()
Returns the number of octets needed to marshall the service.
[more]int GetPid()
Returns the process id of the parent library
[more]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.
o CService(const CService& aOriginal)
Copy constructor. Creates an exact copy of the original object.

Parameters:
aOriginal - The original object to be copied.
Returns:
none

o 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

o 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

o 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

oconst string& GetAttributeString()
Returns service's attributes. The format is "key value", with space between each key-value pair.

Returns:
service's attribute string

obool 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

oconst 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

ochar* 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

oint MarshalledLength()
Returns the number of octets needed to marshall the service.

Returns:
the number of octets required to marshall the service

oint 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

ounsigned 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++.