osg::ConnectionType Class Reference
[Network]

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  createGroup,
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 66 of file OSGConnectionType.cpp.

References osg::ConnectionFactory::addGroupType(), and osg::ConnectionFactory::the().

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

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 79 of file OSGConnectionType.cpp.

References osg::ConnectionFactory::addPointType(), and osg::ConnectionFactory::the().

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

osg::ConnectionType::ConnectionType ( const ConnectionType source  ) 

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

ConnectionType::~ConnectionType ( void   )  [virtual]

Destructor. Unregister the connection from the factory

Definition at line 93 of file OSGConnectionType.cpp.

References _createGroup, _createPoint, osg::ConnectionFactory::subGroupType(), osg::ConnectionFactory::subPointType(), and osg::ConnectionFactory::the().

00094 {
00095     if(_createGroup)
00096         ConnectionFactory::the().subGroupType(this);
00097     if(_createPoint)
00098         ConnectionFactory::the().subPointType(this);
00099 }


Member Function Documentation

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

get conneciton create function

Definition at line 154 of file OSGConnectionType.cpp.

References _createGroup.

00155 {
00156     return _createGroup;
00157 }

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

get conneciton create function

Definition at line 161 of file OSGConnectionType.cpp.

References _createPoint.

00162 {
00163     return _createPoint;
00164 }

PointConnection * ConnectionType::createPoint ( void   ) 

create Connection

Definition at line 178 of file OSGConnectionType.cpp.

References _createPoint.

00179 {
00180     return _createPoint();
00181 }

GroupConnection * ConnectionType::createGroup ( void   ) 

create Connection

Definition at line 171 of file OSGConnectionType.cpp.

References _createGroup.

00172 {
00173     return _createGroup();
00174 }

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

assignment

Definition at line 106 of file OSGConnectionType.cpp.

References _createGroup, _createPoint, and _name.

00107 {
00108     if(this == &source)
00109         return *this;
00110 
00111     _name        = source._name;
00112     _createGroup = source._createGroup;
00113     _createPoint = source._createPoint;
00114     return *this;
00115 }

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

less

Definition at line 122 of file OSGConnectionType.cpp.

References _name.

00123 {
00124     return _name < other._name;
00125 }

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

equal

Definition at line 129 of file OSGConnectionType.cpp.

References _name.

00130 {
00131     return _name == other._name;
00132 }

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

unequal

Definition at line 136 of file OSGConnectionType.cpp.

00137 {
00138     return ! (*this == other);
00139 }


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:

Generated on 8 Feb 2010 for OpenSG by  doxygen 1.6.1