![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
The RPC4 plugin is just an association between a C function pointer and a string. More...
#include <RPC4Plugin.h>
Inheritance diagram for RakNet::RPC4:Classes | |
| struct | LocalCallback |
| struct | LocalSlot |
| struct | LocalSlotObject |
Public Member Functions | |
| void | Call (const char *uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast) |
| bool | CallBlocking (const char *uniqueID, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, RakNet::BitStream *returnData) |
| Same as call, but don't return until the remote system replies. Broadcasting parameter does not exist, this can only call one remote system. | |
| void | CallLoopback (const char *uniqueID, RakNet::BitStream *bitStream) |
| void | InterruptSignal (void) |
| If called while processing a slot, no further slots for the currently executing signal will be executed. | |
| bool | RegisterBlockingFunction (const char *uniqueID, void(*functionPointer)(RakNet::BitStream *userData, RakNet::BitStream *returnData, Packet *packet)) |
| Same as RegisterFunction, but is called with CallBlocking() instead of Call() and returns a value to the caller. | |
| bool | RegisterFunction (const char *uniqueID, void(*functionPointer)(RakNet::BitStream *userData, Packet *packet)) |
| Register a function pointer to be callable from a remote system. | |
| void | RegisterLocalCallback (const char *uniqueID, MessageID messageId) |
| void | RegisterSlot (const char *sharedIdentifier, void(*functionPointer)(RakNet::BitStream *userData, Packet *packet), int callPriority) |
| RPC4 () | |
| void | Signal (const char *sharedIdentifier, RakNet::BitStream *bitStream, PacketPriority priority, PacketReliability reliability, char orderingChannel, const AddressOrGUID systemIdentifier, bool broadcast, bool invokeLocal) |
| bool | UnregisterBlockingFunction (const char *uniqueID) |
| Same as UnregisterFunction, except for a blocking function. | |
| bool | UnregisterFunction (const char *uniqueID) |
| Unregister a function pointer previously registered with RegisterFunction() | |
| bool | UnregisterLocalCallback (const char *uniqueID, MessageID messageId) |
| bool | UnregisterSlot (const char *sharedIdentifier) |
| virtual | ~RPC4 () |
Static Public Member Functions | |
| static void | DestroyInstance (RPC4 *i) |
| static RPC4 * | GetInstance (void) |
| static int | LocalCallbackComp (const MessageID &key, LocalCallback *const &data) |
| static int | LocalSlotObjectComp (const LocalSlotObject &key, const LocalSlotObject &data) |
Public Attributes | |
| DataStructures::Hash < RakNet::RakString, LocalSlot *, 256, RakNet::RakString::ToInteger > | localSlots |
Protected Member Functions | |
| DataStructures::HashIndex | GetLocalSlotIndex (const char *sharedIdentifier) |
| void | InvokeSignal (DataStructures::HashIndex functionIndex, RakNet::BitStream *serializedParameters, Packet *packet) |
| virtual void | OnAttach (void) |
| Called when the interface is attached. | |
| virtual PluginReceiveResult | OnReceive (Packet *packet) |
Protected Attributes | |
| RakNet::BitStream | blockingReturnValue |
| bool | gotBlockingReturnValue |
| bool | interruptSignal |
| DataStructures::OrderedList < MessageID, LocalCallback *, RPC4::LocalCallbackComp > | localCallbacks |
| unsigned int | nextSlotRegistrationCount |
| Used so slots are called in the order they are registered. | |
| DataStructures::Hash < RakNet::RakString, void(*)(RakNet::BitStream *, RakNet::BitStream *, Packet *), 64, RakNet::RakString::ToInteger | registeredBlockingFunctions ) |
| DataStructures::Hash < RakNet::RakString, void(*)(RakNet::BitStream *, Packet *), 64, RakNet::RakString::ToInteger | registeredNonblockingFunctions ) |
It is for users that want to use RPC, but do not want to use boost. You do not have the automatic serialization or other features of RPC3, and C++ member calls are not supported.
Definition at line 70 of file RPC4Plugin.h.
| RakNet::RPC4::RPC4 | ( | ) |
| virtual RakNet::RPC4::~RPC4 | ( | ) | [virtual] |
| void RakNet::RPC4::Call | ( | const char * | uniqueID, |
| RakNet::BitStream * | bitStream, | ||
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| bool | broadcast | ||
| ) |
| [in] | uniqueID | Identifier originally passed to RegisterFunction() on the remote system(s) |
| [in] | bitStream | bitStream encoded data to send to the function callback |
| [in] | priority | See RakPeerInterface::Send() |
| [in] | reliability | See RakPeerInterface::Send() |
| [in] | orderingChannel | See RakPeerInterface::Send() |
| [in] | systemIdentifier | See RakPeerInterface::Send() |
| [in] | broadcast | See RakPeerInterface::Send() |
| bool RakNet::RPC4::CallBlocking | ( | const char * | uniqueID, |
| RakNet::BitStream * | bitStream, | ||
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| RakNet::BitStream * | returnData | ||
| ) |
| [in] | Identifier | originally passed to RegisterBlockingFunction() on the remote system(s) |
| [in] | bitStream | bitStream encoded data to send to the function callback |
| [in] | priority | See RakPeerInterface::Send() |
| [in] | reliability | See RakPeerInterface::Send() |
| [in] | orderingChannel | See RakPeerInterface::Send() |
| [in] | systemIdentifier | See RakPeerInterface::Send() |
| [out] | returnData | Written to by the function registered with RegisterBlockingFunction. |
| void RakNet::RPC4::CallLoopback | ( | const char * | uniqueID, |
| RakNet::BitStream * | bitStream | ||
| ) |
| [in] | Identifier | originally passed to RegisterFunction() on the local system |
| [in] | bitStream | bitStream encoded data to send to the function callback |
| static void RakNet::RPC4::DestroyInstance | ( | RPC4 * | i | ) | [static] |
| static RPC4* RakNet::RPC4::GetInstance | ( | void | ) | [static] |
| DataStructures::HashIndex RakNet::RPC4::GetLocalSlotIndex | ( | const char * | sharedIdentifier | ) | [protected] |
| void RakNet::RPC4::InterruptSignal | ( | void | ) |
| void RakNet::RPC4::InvokeSignal | ( | DataStructures::HashIndex | functionIndex, |
| RakNet::BitStream * | serializedParameters, | ||
| Packet * | packet | ||
| ) | [protected] |
| static int RakNet::RPC4::LocalCallbackComp | ( | const MessageID & | key, |
| LocalCallback *const & | data | ||
| ) | [static] |
| static int RakNet::RPC4::LocalSlotObjectComp | ( | const LocalSlotObject & | key, |
| const LocalSlotObject & | data | ||
| ) | [static] |
| virtual void RakNet::RPC4::OnAttach | ( | void | ) | [protected, virtual] |
Reimplemented from RakNet::PluginInterface2.
| virtual PluginReceiveResult RakNet::RPC4::OnReceive | ( | Packet * | packet | ) | [protected, virtual] |
OnReceive is called for every packet.
| [in] | packet | the packet that is being returned to the user |
Reimplemented from RakNet::PluginInterface2.
| bool RakNet::RPC4::RegisterBlockingFunction | ( | const char * | uniqueID, |
| void(*)(RakNet::BitStream *userData, RakNet::BitStream *returnData, Packet *packet) | functionPointer | ||
| ) |
| bool RakNet::RPC4::RegisterFunction | ( | const char * | uniqueID, |
| void(*)(RakNet::BitStream *userData, Packet *packet) | functionPointer | ||
| ) |
The hash of the function name will be stored as an association with the function pointer When a call is made to call this function from the Call() or CallLoopback() function, the function pointer will be invoked with the passed bitStream to Call() and the actual Packet that RakNet got.
| [in] | uniqueID | Identifier to be associated with functionPointer. If this identifier is already in use, the call will return false. |
| [in] | functionPointer | C function pointer to be called |
| void RakNet::RPC4::RegisterLocalCallback | ( | const char * | uniqueID, |
| MessageID | messageId | ||
| ) |
| [in] | uniqueID | Identifier passed to RegisterFunction() |
| [in] | messageId | What RakNet packet ID to call on, for example ID_DISCONNECTION_NOTIFICATION or ID_CONNECTION_LOST |
| void RakNet::RPC4::RegisterSlot | ( | const char * | sharedIdentifier, |
| void(*)(RakNet::BitStream *userData, Packet *packet) | functionPointer, | ||
| int | callPriority | ||
| ) |
Register a slot, which is a function pointer to one or more implementations that supports this function signature When a signal occurs, all slots with the same identifier are called.
| [in] | sharedIdentifier | A string to identify the slot. Recommended to be the same as the name of the function. |
| [in] | functionPtr | Pointer to the function. For C, just pass the name of the function. For C++, use ARPC_REGISTER_CPP_FUNCTION |
| [in] | callPriority | Slots are called by order of the highest callPriority first. For slots with the same priority, they are called in the order they are registered |
| void RakNet::RPC4::Signal | ( | const char * | sharedIdentifier, |
| RakNet::BitStream * | bitStream, | ||
| PacketPriority | priority, | ||
| PacketReliability | reliability, | ||
| char | orderingChannel, | ||
| const AddressOrGUID | systemIdentifier, | ||
| bool | broadcast, | ||
| bool | invokeLocal | ||
| ) |
Calls zero or more functions identified by sharedIdentifier registered with RegisterSlot()
| [in] | sharedIdentifier | parameter of the same name passed to RegisterSlot() on the remote system |
| [in] | bitStream | bitStream encoded data to send to the function callback |
| [in] | priority | See RakPeerInterface::Send() |
| [in] | reliability | See RakPeerInterface::Send() |
| [in] | orderingChannel | See RakPeerInterface::Send() |
| [in] | systemIdentifier | See RakPeerInterface::Send() |
| [in] | broadcast | See RakPeerInterface::Send() |
| [in] | invokeLocal | If true, also sends to self. |
| bool RakNet::RPC4::UnregisterBlockingFunction | ( | const char * | uniqueID | ) |
| bool RakNet::RPC4::UnregisterFunction | ( | const char * | uniqueID | ) |
| [in] | Identifier | originally passed to RegisterFunction() |
Remove the association created with RegisterPacketCallback()
| [in] | uniqueID | Identifier passed as uniqueID to RegisterLocalCallback() |
| [in] | messageId | Identifier passed as messageId to RegisterLocalCallback() |
| bool RakNet::RPC4::UnregisterSlot | ( | const char * | sharedIdentifier | ) |
Remove the association created with RegisterSlot()
| [in] | sharedIdentifier | Identifier passed as sharedIdentifier to RegisterSlot() |
RakNet::BitStream RakNet::RPC4::blockingReturnValue [protected] |
Definition at line 215 of file RPC4Plugin.h.
bool RakNet::RPC4::gotBlockingReturnValue [protected] |
Definition at line 216 of file RPC4Plugin.h.
bool RakNet::RPC4::interruptSignal [protected] |
Definition at line 223 of file RPC4Plugin.h.
DataStructures::OrderedList<MessageID,LocalCallback*,RPC4::LocalCallbackComp> RakNet::RPC4::localCallbacks [protected] |
Definition at line 213 of file RPC4Plugin.h.
| DataStructures::Hash<RakNet::RakString, LocalSlot*,256, RakNet::RakString::ToInteger> RakNet::RPC4::localSlots |
Definition at line 201 of file RPC4Plugin.h.
unsigned int RakNet::RPC4::nextSlotRegistrationCount [protected] |
Definition at line 221 of file RPC4Plugin.h.
DataStructures::Hash<RakNet::RakString, void ( * ) ( RakNet::BitStream *, RakNet::BitStream *, Packet * ),64, RakNet::RakString::ToInteger RakNet::RPC4::registeredBlockingFunctions) [protected] |
Definition at line 212 of file RPC4Plugin.h.
DataStructures::Hash<RakNet::RakString, void ( * ) ( RakNet::BitStream *, Packet * ),64, RakNet::RakString::ToInteger RakNet::RPC4::registeredNonblockingFunctions) [protected] |
Definition at line 211 of file RPC4Plugin.h.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.