Implementation of the MAbstractDevice interface. This version is used by the PeerHood daemon and the plugins.
Inheritance:
Public Methods
-
CDaemonDevice(const CDaemonDevice& aOriginal)
- Copy constructor.
-
CDaemonDevice(const char* aData)
- Constructor, that creates a device from the marshalled data.
-
CDaemonDevice(const std::string& aDeviceAddress)
- Constructor, sets internal variables to their default values.
-
CDaemonDevice(const std::string& aDeviceAddress, const std::string& aReferrerName)
- Constructor with referrer, sets internal variables to their default values.
-
void SetTimestamp(int aValue)
- Sets device's timestamp value. This value can be used by the plugins.
-
void IncreaseTimestamp()
- Increases device's timestamp by one.
-
int GetTimestamp()
- Returns device's current timestamp value.
-
void SetPrototype(const char* aProto)
- Sets device's prototype id.
-
char* MarshallL(int* aLength)
- Converts class' information to an octet stream.
-
void SetPeerHood(bool aHasPeerHood)
- Sets device's PeerHood flag.
-
void SetDeviceName(const std::string& aDeviceName)
- Sets device's name.
-
void SetChecksum(int aChecksum)
- Sets device's checksum number.
-
void SetReferrerName(const std::string& aReferrerName)
- Sets referrer's name.
-
void AddNeighboringDevice(CDaemonDevice* aDaemonDevice)
- Adds a new neigboring device to the device.
-
void AddPrototype(char* aPrototype)
- Adds a new neigboring device to the device.
Public Methods
-
void AddService(CService* aService)
-
const std::string& GetAddress()
-
const std::string& GetName()
-
bool HasPeerHood()
-
const std::string& GetPrototype()
-
bool HasService(const std::string& aServiceName)
-
TServiceList* GetServiceListL()
-
int GetChecksum()
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>.
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
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
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
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
void 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
void IncreaseTimestamp()
-
Increases device's timestamp by one.
- Returns:
- none
int GetTimestamp()
-
Returns device's current timestamp value.
- Returns:
- the current timestamp of the device
void 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
char* 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
void 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
void SetDeviceName(const std::string& aDeviceName)
-
Sets devices's name.
- Parameters:
- aDeviceName - User-defined device name
- Returns:
- none
void SetChecksum(int aChecksum)
-
Sets device's checksum number
- Parameters:
- aChecksum - New checksum number for device
- Returns:
- none
void 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
void 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
void 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++.