NetworkInterface Class Reference
#include <NetworkInterface.h>
Inherits ModuleInterface.
Inherited by Network.

Public Member Functions | |
| virtual std::string | getName ()=0 |
| virtual void | cleanup ()=0 |
| virtual bool | connect (std::string nodeName)=0 |
| virtual int | sizeRecvList (uint8_t channelId=0)=0 |
| virtual NetMessage * | peek (uint8_t channelId=0)=0 |
| virtual NetMessage * | pop (uint8_t channelId=0)=0 |
| virtual void | popAll (uint8_t channelId, std::vector< NetMessage * > *dst)=0 |
| virtual void | sendMessageTCP (NetMessage *msg, uint8_t channelId=0)=0 |
| virtual void | sendMessageUDP (NetMessage *msg, uint8_t channelId=0)=0 |
| virtual void | sendMessageTCPTo (NetMessage *msg, uint8_t channelId, unsigned userId)=0 |
| virtual void | sendMessageUDPTo (NetMessage *msg, uint8_t channelId, unsigned userId)=0 |
| virtual NetworkIdentification | getLocalIdentification ()=0 |
| virtual int | getNumberOfParticipants ()=0 |
| virtual void | sendTransformation (TransformationData &trans, TransformationPipe *pipe, bool useTCP)=0 |
| virtual void | sendEvent (Event *event)=0 |
| virtual void | flush ()=0 |
| void | registerConnectionClosedCallback (CLIENTDISCONNECTEDCALLBACK callback, unsigned userId, void *whateveryouwant) |
Static Public Member Functions | |
| static std::string | ipAddressToString (uint32_t ip) |
| static uint32_t | ipAddressFromString (std::string ip) |
| static void | addNetworkIdentificationToBinaryMessage (NetworkIdentification *netId, NetMessage *dst) |
| static NetworkIdentification | readNetworkIdentificationFrom (NetMessage *src) |
Protected Member Functions | |
| virtual void | onConnectionClosed (unsigned userId) |
Protected Attributes | |
| std::vector < CLIENTDISCONNECTEDCALLBACK > | onDisconectCallbacks |
| std::vector< void * > | onDisconectCallbackArgs |
Member Function Documentation
| void NetworkInterface::addNetworkIdentificationToBinaryMessage | ( | NetworkIdentification * | netId, | |
| NetMessage * | dst | |||
| ) | [static] |
| virtual void NetworkInterface::cleanup | ( | ) | [pure virtual] |
Instruct the module to free all memory allocated internally.
Reimplemented from ModuleInterface.
Implemented in Network.
| virtual bool NetworkInterface::connect | ( | std::string | nodeName | ) | [pure virtual] |
- Todo:
- SYNCHRONISATION IS HAPPENING AT CONNECT !!! REMEMBER THE TRANSMISSION OF PIPE SETUP !!! Helmut: should consider doing that somewhere else (i.e.: TransformationManager::runFirst()), is that really needed for all applications?
- Parameters:
-
nodeName node where the local process should connect to, the content of nodeName is implementation dependent
- Returns:
- true if connection has been established
Implemented in Network.
| virtual void NetworkInterface::flush | ( | ) | [pure virtual] |
blocks current thread until all messages are sent
Implemented in Network.
| virtual NetworkIdentification NetworkInterface::getLocalIdentification | ( | ) | [pure virtual] |
Implemented in Network.
| virtual std::string NetworkInterface::getName | ( | ) | [pure virtual] |
| virtual int NetworkInterface::getNumberOfParticipants | ( | ) | [pure virtual] |
DEPRECATED. Needed by the Transformation Manager during initialization (runFirst()). I hope we can get rid of it soon!
- Returns:
- returns the number of users in the network (not including the local user)
Implemented in Network.
| uint32_t NetworkInterface::ipAddressFromString | ( | std::string | ip | ) | [static] |
| std::string NetworkInterface::ipAddressToString | ( | uint32_t | ip | ) | [static] |
| void NetworkInterface::onConnectionClosed | ( | unsigned | userId | ) | [protected, virtual] |
| virtual NetMessage* NetworkInterface::peek | ( | uint8_t | channelId = 0 |
) | [pure virtual] |
Implemented in Network.
| virtual NetMessage* NetworkInterface::pop | ( | uint8_t | channelId = 0 |
) | [pure virtual] |
Implemented in Network.
| virtual void NetworkInterface::popAll | ( | uint8_t | channelId, | |
| std::vector< NetMessage * > * | dst | |||
| ) | [pure virtual] |
Implemented in Network.
| NetworkIdentification NetworkInterface::readNetworkIdentificationFrom | ( | NetMessage * | src | ) | [static] |
| void NetworkInterface::registerConnectionClosedCallback | ( | CLIENTDISCONNECTEDCALLBACK | callback, | |
| unsigned | userId, | |||
| void * | whateveryouwant | |||
| ) |
| virtual void NetworkInterface::sendEvent | ( | Event * | event | ) | [pure virtual] |
Visibility of Event is encoded in Event directly (visibilityLevel member) For now the EventManager sets a key "destinationUserId" to tell the network module if the event is addressed for a specific user The EventManager polls incomming events from the channel EVENT_MANAGER_ID
Implemented in Network.
| virtual void NetworkInterface::sendMessageTCP | ( | NetMessage * | msg, | |
| uint8_t | channelId = 0 | |||
| ) | [pure virtual] |
Implemented in Network.
| virtual void NetworkInterface::sendMessageTCPTo | ( | NetMessage * | msg, | |
| uint8_t | channelId, | |||
| unsigned | userId | |||
| ) | [pure virtual] |
Implemented in Network.
| virtual void NetworkInterface::sendMessageUDP | ( | NetMessage * | msg, | |
| uint8_t | channelId = 0 | |||
| ) | [pure virtual] |
Implemented in Network.
| virtual void NetworkInterface::sendMessageUDPTo | ( | NetMessage * | msg, | |
| uint8_t | channelId, | |||
| unsigned | userId | |||
| ) | [pure virtual] |
Implemented in Network.
| virtual void NetworkInterface::sendTransformation | ( | TransformationData & | trans, | |
| TransformationPipe * | pipe, | |||
| bool | useTCP | |||
| ) | [pure virtual] |
a NetMessage with the following layout will be transmitted:
struct MSGCONTENT { uint32_t pipeOwnerUserId; uint64_t pipeId; uint32_t[14] contentOfTrans; // see addTransformationToBinaryMsg() (SystemCore/DataTypes.cpp) };
The message is expected to be addressed to the channel TRANSFORMATION_MANAGER_ID
- Parameters:
-
useTCP is intended to serve as hint
Implemented in Network.
| virtual int NetworkInterface::sizeRecvList | ( | uint8_t | channelId = 0 |
) | [pure virtual] |
Implemented in Network.
Member Data Documentation
std::vector<void*> NetworkInterface::onDisconectCallbackArgs [protected] |
std::vector<CLIENTDISCONNECTEDCALLBACK> NetworkInterface::onDisconectCallbacks [protected] |
The documentation for this class was generated from the following files:
- src/inVRs/SystemCore/ComponentInterfaces/NetworkInterface.h
- src/inVRs/SystemCore/ComponentInterfaces/NetworkInterface.cpp
Generated on Wed Oct 20 16:11:58 2010 for inVRs by
1.5.8