class CDaemonDevice

Implementation of the MAbstractDevice interface. This version is used by the PeerHood daemon and the plugins.

Inheritance:


Public Methods

[more] CDaemonDevice(const CDaemonDevice& aOriginal)
Copy constructor.
[more] CDaemonDevice(const char* aData)
Constructor, that creates a device from the marshalled data.
[more] CDaemonDevice(const std::string& aDeviceAddress)
Constructor, sets internal variables to their default values.
[more] CDaemonDevice(const std::string& aDeviceAddress, const std::string& aReferrerName)
Constructor with referrer, sets internal variables to their default values.
[more]void SetTimestamp(int aValue)
Sets device's timestamp value. This value can be used by the plugins.
[more]void IncreaseTimestamp()
Increases device's timestamp by one.
[more]int GetTimestamp()
Returns device's current timestamp value.
[more]void SetPrototype(const char* aProto)
Sets device's prototype id.
[more]char* MarshallL(int* aLength)
Converts class' information to an octet stream.
[more]void SetPeerHood(bool aHasPeerHood)
Sets device's PeerHood flag.
[more]void SetDeviceName(const std::string& aDeviceName)
Sets device's name.
[more]void SetChecksum(int aChecksum)
Sets device's checksum number.
[more]void SetReferrerName(const std::string& aReferrerName)
Sets referrer's name.
[more]void AddNeighboringDevice(CDaemonDevice* aDaemonDevice)
Adds a new neigboring device to the device.
[more]void AddPrototype(char* aPrototype)
Adds a new neigboring device to the device.


Inherited from CBaseDevice:

Public Methods

ovoid AddService(CService* aService)
oconst std::string& GetAddress()
oconst std::string& GetName()
obool HasPeerHood()
oconst std::string& GetPrototype()
obool HasService(const std::string& aServiceName)
oTServiceList* GetServiceListL()
oint GetChecksum()


Inherited from MAbstractDevice:


Documentation

Implementation of the MAbstractDevice interface. This version is used by the PeerHood daemon and the plugins. The specialities of this version are functions that allow modifications to the stored data unlike in the case of <code>CLibDevice</code>.

o CDaemonDevice(const CDaemonDevice& aOriginal)
Copy constructor. This makes the new object to be an exact copy of the original object.

Parameters:
- CDaemonDevice The object to be copied.
Returns:
none

o CDaemonDevice(const char* aData)
Constructor, that creates a device from the marshalled data. The + values will be copied from the data

Parameters:
aData - Marshalled data of the device information
Returns:
none

o CDaemonDevice(const std::string& aDeviceAddress)
Constructor, sets internal variables to their default values. These values include timestamp, name, the number of services, PeerHood awaresness etc.

Parameters:
aDeviceAddress - the address of the device
Returns:
none

o CDaemonDevice(const std::string& aDeviceAddress, const std::string& aReferrerName)
Constructor, sets internal variables to their default values. These values include timestamp, name, the number of services, PeerHood awaresness, referrer device for neighbourhood information etc.

Parameters:
aDeviceAddress - the address of the device, + aReferrerName the name of the referring neighbourhood
Returns:
none

ovoid SetTimestamp(int aValue)
Sets device's timestamp value. This value can be used by the plugins e.g. to determine if the device should be removed from the device & service database.

Parameters:
aValue - new timestamp value
Returns:
none

ovoid IncreaseTimestamp()
Increases device's timestamp by one.

Returns:
none

oint GetTimestamp()
Returns device's current timestamp value.

Returns:
the current timestamp of the device

ovoid SetPrototype(const char* aProto)
Sets device's prototype id. This id is unique for each network, so in practice each plugin should use a different id.

Returns:
none

ochar* MarshallL(int* aLength)
Converts class' 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 (in octets): <ll> <li>0 length of the name field</li> <li>1 length of the prototype field</li> <li>2..5 device's port number</li> <li>6 flag indicating the presence of PeerHood (0 = no, 1 = yes) <li>7.. name of the device</li> <li>n.. prototype id of the device</li> </ll>

Parameters:
aLength - Integer that on return will hold the length of the created octet stream.
Returns:
octet presentation of the class' information

ovoid SetPeerHood(bool aHasPeerHood)
Sets device's PeerHood flag. If the flag is set then the device has PeerHood capability, otherwise there's no sign of it.

Parameters:
aHasPeerHood - New value of the PeerHood flag.
Returns:
none

ovoid SetDeviceName(const std::string& aDeviceName)
Sets devices's name.

Parameters:
aDeviceName - User-defined device name
Returns:
none

ovoid SetChecksum(int aChecksum)
Sets device's checksum number

Parameters:
aChecksum - New checksum number for device
Returns:
none

ovoid SetReferrerName(const std::string& aReferrerName)
Sets referrer's name. If set, this device is not connected directly but through a neighbour. Used when neighbourhood information is used.

Parameters:
aReferrerName - User-defined device name
Returns:
none

ovoid AddNeighboringDevice(CDaemonDevice* aDaemonDevice)
Adds a new neigboring device to the device. No checking to the validity of the given service entry is performed, except the NULL check. If the given service is NULL then an assertion will take place.

Returns:
none

ovoid AddPrototype(char* aPrototype)
Adds a new neigboring device to the device. No checking to the validity of the given service entry is performed, except the NULL check. If the given service is NULL then an assertion will take place.

Returns:
none


This class has no child classes.
See Also:
MAbstractDevice
CBaseDevice
CLibDevice

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.