vrpn  07.33
Virtual Reality Peripheral Network
vrpn_ConnectionManager Class Reference

Singleton class that keeps track of all known VRPN connections and makes sure they're deleted on shutdown. More...

#include <vrpn_Connection.h>

Public Member Functions

 ~vrpn_ConnectionManager (void)
 
vrpn_ConnectiongetByName (const char *name)
 Searches through d_kcList but NOT d_anonList (Connections constructed with no name) More...
 
void addConnection (vrpn_Connection *, const char *name)
 NB implementation is not particularly efficient; we expect to have O(10) connections, not O(1000). More...
 
void deleteConnection (vrpn_Connection *)
 

Static Public Member Functions

static vrpn_ConnectionManagerinstance (void)
 The only way to get access to an instance of this class. Guarantees that there is only one, global object. Also guarantees that it will be constructed the first time this function is called, and (hopefully?) destructed when the program terminates. More...
 

Detailed Description

Singleton class that keeps track of all known VRPN connections and makes sure they're deleted on shutdown.

We make it static to guarantee that the destructor is called on program close so that the destructors of all the vrpn_Connections that have been allocated are called so that all open logs are flushed to disk. Each connection should add itself to this list in its constructor and should remove itself from this list in its destructor.

Definition at line 1062 of file vrpn_Connection.h.

Constructor & Destructor Documentation

◆ ~vrpn_ConnectionManager()

vrpn_ConnectionManager::~vrpn_ConnectionManager ( void  )

Definition at line 1412 of file vrpn_Connection.C.

Member Function Documentation

◆ addConnection()

void vrpn_ConnectionManager::addConnection ( vrpn_Connection c,
const char *  name 
)

NB implementation is not particularly efficient; we expect to have O(10) connections, not O(1000).

Definition at line 1434 of file vrpn_Connection.C.

Referenced by vrpn_Connection_Loopback::vrpn_Connection_Loopback(), and vrpn_File_Connection::vrpn_File_Connection().

◆ deleteConnection()

◆ getByName()

vrpn_Connection * vrpn_ConnectionManager::getByName ( const char *  name)

Searches through d_kcList but NOT d_anonList (Connections constructed with no name)

Definition at line 1478 of file vrpn_Connection.C.

Referenced by vrpn_get_connection_by_name().

◆ instance()

vrpn_ConnectionManager & vrpn_ConnectionManager::instance ( void  )
static

The only way to get access to an instance of this class. Guarantees that there is only one, global object. Also guarantees that it will be constructed the first time this function is called, and (hopefully?) destructed when the program terminates.

Definition at line 1428 of file vrpn_Connection.C.

Referenced by vrpn_Connection_Loopback::vrpn_Connection_Loopback(), vrpn_File_Connection::vrpn_File_Connection(), vrpn_get_connection_by_name(), vrpn_Connection_IP::~vrpn_Connection_IP(), vrpn_Connection_Loopback::~vrpn_Connection_Loopback(), and vrpn_File_Connection::~vrpn_File_Connection().


The documentation for this class was generated from the following files: