Erratic Class Reference
Public Member Functions | |
Erratic (ConfigFile *cf, int section) | |
virtual int | Subscribe (player_devaddr_t id) |
Subscribe to this driver. | |
virtual int | Unsubscribe (player_devaddr_t id) |
Unsubscribe from this driver. | |
virtual void | Main () |
Talking to the Player architecture. | |
virtual int | Setup () |
Initialize the driver. | |
virtual int | Shutdown () |
Finalize the driver. | |
virtual int | ProcessMessage (MessageQueue *resp_queue, player_msghdr *hdr, void *data) |
Message handler. |
Member Function Documentation
int Erratic::ProcessMessage | ( | MessageQueue * | resp_queue, | |
player_msghdr * | hdr, | |||
void * | data | |||
) | [virtual] |
Message handler.
This function is called once for each message in the incoming queue. Reimplement it to provide message handling. Return 0 if you handled the message and -1 otherwise
- Parameters:
-
resp_queue The queue to which any response should go. hdr The message header data The message body
Reimplemented from Driver.
References PLAYER_MSGTYPE_CMD, PLAYER_MSGTYPE_REQ, and player_msghdr::type.
int Erratic::Setup | ( | ) | [virtual] |
Initialize the driver.
This function is called with the first client subscribes; it MUST be implemented by the driver.
- Returns:
- Returns 0 on success.
Implements Driver.
int Erratic::Shutdown | ( | ) | [virtual] |
Finalize the driver.
This function is called with the last client unsubscribes; it MUST be implemented by the driver.
- Returns:
- Returns 0 on success.
Implements Driver.
int Erratic::Subscribe | ( | player_devaddr_t | addr | ) | [virtual] |
Subscribe to this driver.
The Subscribe() and Unsubscribe() methods are used to control subscriptions to the driver; a driver MAY override them, but usually won't.
- Parameters:
-
addr Address of the device to subscribe to (the driver may have more than one interface).
- Returns:
- Returns 0 on success.
Reimplemented from Driver.
References Device::MatchDeviceAddress(), and Driver::Subscribe().
int Erratic::Unsubscribe | ( | player_devaddr_t | addr | ) | [virtual] |
Unsubscribe from this driver.
The Subscribe() and Unsubscribe() methods are used to control subscriptions to the driver; a driver MAY override them, but usually won't.
- Parameters:
-
addr Address of the device to unsubscribe from (the driver may have more than one interface).
- Returns:
- Returns 0 on success.
Reimplemented from Driver.
References Device::MatchDeviceAddress(), and Driver::Unsubscribe().
The documentation for this class was generated from the following files:
- erratic.h
- erratic.cc