OSG::ConnectionType Class Reference

Types for Connection, see XXX for details. More...

#include <OSGConnectionType.h>

List of all members.


Public Types

Types


typedef PointConnection *(*) CreatePointFunction (void)
typedef GroupConnection *(*) CreateGroupFunction (void)

Public Member Functions

Constructors


 ConnectionType (CreateGroupFunction, const std::string &name)
 ConnectionType (CreatePointFunction, const std::string &name)
 ConnectionType (const ConnectionType &source)
Destructor


virtual ~ConnectionType (void)
Get


std::string getName (void) const
CreateGroupFunction getCreateGroup (void) const
CreatePointFunction getCreatePoint (void) const
creation


PointConnectioncreatePoint (void)
GroupConnectioncreateGroup (void)
Assignment


ConnectionTypeoperator= (const ConnectionType &source)
Comparison


bool operator< (const ConnectionType &other) const
bool operator== (const ConnectionType &other) const
bool operator!= (const ConnectionType &other) const

Protected Attributes

CreateGroupFunction _createGroup
CreatePointFunction _createPoint
std::string _name

Detailed Description

A connection type describes a network connection and provides an interface for dynamic connection creation.

Definition at line 57 of file OSGConnectionType.h.


Member Typedef Documentation

Definition at line 66 of file OSGConnectionType.h.

Definition at line 67 of file OSGConnectionType.h.


Constructor & Destructor Documentation

ConnectionType::ConnectionType ( CreateGroupFunction  ,
const std::string &  name 
)

Definition at line 67 of file OSGConnectionType.cpp.

00068                                                                       :
00069     _createGroup(createGroup),
00070     _createPoint(NULL),
00071     _name(name)
00072 {
00073     ConnectionFactory::the()->addGroupType(this);
00074 }
 

ConnectionType::ConnectionType ( CreatePointFunction  createPoint,
const std::string &  name 
)

Constructor. A new connection with the given name is registered. To create a new connection, the given functions for group and point are called

Definition at line 80 of file OSGConnectionType.cpp.

00081                                                                       :
00082     _createGroup(NULL),
00083     _createPoint(createPoint),
00084     _name(name)
00085 {
00086     ConnectionFactory::the()->addPointType(this);
00087 }

ConnectionType::ConnectionType ( const ConnectionType source  ) 

Definition at line 89 of file OSGConnectionType.cpp.

00089                                                            :
00090     _name(source._name),
00091     _createGroup(source._createGroup),
00092     _createPoint(source._createPoint)
00093 {
00094 }

ConnectionType::~ConnectionType ( void   )  [virtual]

Definition at line 101 of file OSGConnectionType.cpp.

References _createGroup, _createPoint, OSG::GlobalSystemState, and OSG::Shutdown.

00102 {
00103     if(_createGroup != NULL && GlobalSystemState != Shutdown)
00104         ConnectionFactory::the()->subGroupType(this);
00105 
00106     if(_createPoint != NULL && GlobalSystemState != Shutdown)
00107         ConnectionFactory::the()->subPointType(this);
00108 }


Member Function Documentation

std::string ConnectionType::getName ( void   )  const

ConnectionType::CreateGroupFunction ConnectionType::getCreateGroup ( void   )  const

get conneciton create function

Definition at line 164 of file OSGConnectionType.cpp.

References _createGroup.

00165 {
00166     return _createGroup;
00167 }

ConnectionType::CreatePointFunction ConnectionType::getCreatePoint ( void   )  const

get conneciton create function

Definition at line 171 of file OSGConnectionType.cpp.

References _createPoint.

00171                                                                           {
00172     return _createPoint;
00173 }

PointConnection * ConnectionType::createPoint ( void   ) 

Definition at line 187 of file OSGConnectionType.cpp.

References _createPoint.

00188 {
00189      return _createPoint();
00190 }

GroupConnection * ConnectionType::createGroup ( void   ) 

create Connection

Definition at line 180 of file OSGConnectionType.cpp.

References _createGroup.

00181 {
00182     return _createGroup();
00183 }

ConnectionType & ConnectionType::operator= ( const ConnectionType source  ) 

Definition at line 115 of file OSGConnectionType.cpp.

References _createGroup, _createPoint, and _name.

00116 {
00117     if(this == &source)
00118         return *this;
00119 
00120     _name        = source._name;
00121     _createGroup = source._createGroup;
00122     _createPoint = source._createPoint;
00123 
00124     return *this;
00125 }

bool ConnectionType::operator< ( const ConnectionType other  )  const

Definition at line 132 of file OSGConnectionType.cpp.

References _name.

00133 {
00134     return _name < other._name;
00135 }

bool ConnectionType::operator== ( const ConnectionType other  )  const

equal

Definition at line 139 of file OSGConnectionType.cpp.

References _name.

00140 {
00141     return _name == other._name;
00142 }

bool ConnectionType::operator!= ( const ConnectionType other  )  const

unequal

Definition at line 146 of file OSGConnectionType.cpp.

00147 {
00148     return ! (*this == other);
00149 }


Member Data Documentation

Definition at line 124 of file OSGConnectionType.h.

Referenced by createGroup(), getCreateGroup(), operator=(), and ~ConnectionType().

Definition at line 125 of file OSGConnectionType.h.

Referenced by createPoint(), getCreatePoint(), operator=(), and ~ConnectionType().

std::string OSG::ConnectionType::_name [protected]

Definition at line 126 of file OSGConnectionType.h.

Referenced by getName(), operator<(), operator=(), and operator==().


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