The core class of the whole PeerHood system.
Public Methods
-
CEngine* GetInstance(CBasicCallback* aCallback)
- Creates a new instance of the CEngine class.
-
~CEngine()
- Destructor.
-
CEngine(CBasicCallback* aCallback)
- Constructor.
-
void StartListening()
- Starts listening thread.
-
bool LoadConnections(const int aLocalPid)
- Method creates a listening socket for every networking technology
-
void* ThreadStarter(void* aArguments)
- Starts the listening thread.
-
void EternalThread()
- Listens for incoming requests.
Documentation
The core class of the whole PeerHood system. This singleton class is
responsible for receiving incoming method requests handling and dispatching.
If a service is registered then a dedicated thread listens for incoming
requests. If a request is received it is forwarded to a correct dispatcher.
Requests are handled using the fifo (first in first out) methology. If all
services are unregistered then the thread is also terminated.
CEngine* GetInstance(CBasicCallback* aCallback)
-
Creates a new instance of the CEngine class. This method ensures that
at any given moment of time only one instance of this class is running (i.e.
it implements the singleton design pattern). If an instance exists already
then a pointer to it is returned.
- Parameters:
- aCallback - The interface where callback notifications should be sent
to.
- Returns:
- pointer to the active CEngine instance
~CEngine()
-
Destructor, stops the listening thread & frees all allocated memory.
- Returns:
- none
CEngine(CBasicCallback* aCallback)
-
Constructor. This constructor is a protected method so it cannot be
called directly. Instead, use the <code>GetInstance</code> method.
- Parameters:
- aCallback - The interface where callback notifications should be sent
to.
- Returns:
- none
void StartListening()
-
Starts listening thread. This thread listens for incoming connection
requests.
- Returns:
- none
bool LoadConnections(const int aLocalPid)
-
Method creates a listening socket for every networking technology.
These connections listen for incoming connection requests using processID
as port number.
- Parameters:
- aLocalPid - Process ID which is used as a port for listening
- Returns:
- false if something fails (currently returns always true)
void* ThreadStarter(void* aArguments)
-
Starts the listening thread. This static function is used because the
<code>pthread</code> library doesn't allow running a member function in a
thread directly.
- Parameters:
- aArguments - Pointer to the current instance of the <code>CEngine
</code> class.
- Returns:
- always NULL
void EternalThread()
-
Listens for incoming requests and forwards them further. A
request is forwarded to the registered callback interface or simply
discarded if the interface is not registered.
- Returns:
- none
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.