|
MComProxy Class Reference
[Proxies]
#include <playerclient.h>
Inherits ClientProxy.
List of all members.
Detailed Description
The MComProxy class is used to exchange data with other clients connected with the same server, through a set of named "channels" in a mcom device. For some useful (but optional) type and constant definitions that you can use in your clients, see playermcomtypes.h.
|
Public Member Functions |
| MComProxy (PlayerClient *pc, unsigned short index, unsigned char access= 'c') |
int | Pop (int type, char channel[MCOM_CHANNEL_LEN]) |
int | Read (int type, char channel[MCOM_CHANNEL_LEN]) |
int | Push (int type, char channel[MCOM_CHANNEL_LEN], char dat[MCOM_DATA_LEN]) |
int | Clear (int type, char channel[MCOM_CHANNEL_LEN]) |
int | SetCapacity (int type, char channel[MCOM_CHANNEL_LEN], unsigned char cap) |
char * | LastData () |
int | LastMsgType () |
char * | LastChannel () |
void | FillData (player_msghdr_t hdr, const char *buffer) |
void | Print () |
Public Attributes |
player_mcom_data_t | data |
int | type |
char | channel [MCOM_CHANNEL_LEN] |
Constructor & Destructor Documentation
MComProxy::MComProxy |
( |
PlayerClient * |
pc, |
|
|
unsigned short |
index, |
|
|
unsigned char |
access = 'c' |
|
) |
[inline] |
|
Member Function Documentation
int MComProxy::Pop |
( |
int |
type, |
|
|
char |
channel[MCOM_CHANNEL_LEN] |
|
) |
|
|
|
Read and remove the most recent buffer in 'channel' with type 'type'. The result can be read with LastData() after the next call to PlayerClient::Read(). - Returns:
- 0 if no error
-1 on error, the channel does not exist, or the channel is empty.
|
int MComProxy::Read |
( |
int |
type, |
|
|
char |
channel[MCOM_CHANNEL_LEN] |
|
) |
|
|
|
Read the most recent buffer in 'channel' with type 'type'. The result can be read with LastData() after the next call to PlayerClient::Read(). - Returns:
- 0 if no error
-1 on error, the channel does not exist, or the channel is empty.
|
int MComProxy::Push |
( |
int |
type, |
|
|
char |
channel[MCOM_CHANNEL_LEN], |
|
|
char |
dat[MCOM_DATA_LEN] |
|
) |
|
|
|
Push a message 'dat' into channel 'channel' with message type 'type'. |
int MComProxy::Clear |
( |
int |
type, |
|
|
char |
channel[MCOM_CHANNEL_LEN] |
|
) |
|
|
|
Clear all messages of type 'type' on channel 'channel' |
int MComProxy::SetCapacity |
( |
int |
type, |
|
|
char |
channel[MCOM_CHANNEL_LEN], |
|
|
unsigned char |
cap |
|
) |
|
|
|
Set the capacity of the buffer using 'type' and 'channel' to 'cap'. Note that 'cap' is an unsigned char and must be < MCOM_N_BUFS |
char* MComProxy::LastData |
( |
|
) |
[inline] |
|
int MComProxy::LastMsgType |
( |
|
) |
[inline] |
|
char* MComProxy::LastChannel |
( |
|
) |
[inline] |
|
void MComProxy::FillData |
( |
player_msghdr_t |
hdr, |
|
|
const char * |
buffer |
|
) |
[virtual] |
|
|
All proxies must provide this method. It is used internally to parse new data when it is received.
Reimplemented from ClientProxy. |
void MComProxy::Print |
( |
|
) |
[virtual] |
|
|
All proxies SHOULD provide this method, which should print out, in a human-readable form, the device's current state.
Reimplemented from ClientProxy. |
Member Data Documentation
|
These members contain the results of the last command. Note: It's better to use the LastData() method. |
The documentation for this class was generated from the following file:
Generated on Tue May 3 14:15:52 2005 for Player by 1.3.6
|