opal::BlueprintInstance Class Reference

#include <BlueprintInstance.h>

List of all members.

Public Member Functions

OPAL_DECL BlueprintInstance ()
virtual OPAL_DECL ~BlueprintInstance ()
virtual OPAL_DECL Solid *OPAL_CALL getSolid (const std::string &name) const
virtual OPAL_DECL Joint *OPAL_CALL getJoint (const std::string &name) const
virtual OPAL_DECL Motor *OPAL_CALL getMotor (const std::string &name) const
virtual OPAL_DECL Sensor
*OPAL_CALL 
getSensor (const std::string &name) const
virtual OPAL_DECL unsigned
int OPAL_CALL 
getNumSolids () const
virtual OPAL_DECL unsigned
int OPAL_CALL 
getNumJoints () const
virtual OPAL_DECL unsigned
int OPAL_CALL 
getNumMotors () const
virtual OPAL_DECL unsigned
int OPAL_CALL 
getNumSensors () const
virtual OPAL_DECL Solid *OPAL_CALL getSolid (unsigned int i) const
virtual OPAL_DECL Joint *OPAL_CALL getJoint (unsigned int i) const
virtual OPAL_DECL Motor *OPAL_CALL getMotor (unsigned int i) const
virtual OPAL_DECL Sensor
*OPAL_CALL 
getSensor (unsigned int i) const
virtual OPAL_DECL Solid *OPAL_CALL detachSolid (unsigned int i)
virtual OPAL_DECL Joint *OPAL_CALL detachJoint (unsigned int i)
virtual OPAL_DECL Motor *OPAL_CALL detachMotor (unsigned int i)
virtual OPAL_DECL Sensor
*OPAL_CALL 
detachSensor (unsigned int i)
virtual OPAL_DECL Solid *OPAL_CALL detachSolid (const std::string &name)
virtual OPAL_DECL void OPAL_CALL internal_addSolid (Solid *s)
virtual OPAL_DECL void OPAL_CALL internal_addJoint (Joint *j)
virtual OPAL_DECL void OPAL_CALL internal_addMotor (Motor *m)
virtual OPAL_DECL void OPAL_CALL internal_addSensor (Sensor *s)

Private Attributes

std::map< std::string, Solid * > mSolidMap
std::map< std::string, Joint * > mJointMap
std::map< std::string, Motor * > mMotorMap
std::map< std::string, Sensor * > mSensorMap
std::vector< Solid * > mSolidList
std::vector< Joint * > mJointList
std::vector< Motor * > mMotorList
std::vector< Sensor * > mSensorList


Detailed Description

After instantiating a Blueprint, this container class holds pointers to the objects in the Blueprint with names. Pointers to specific objects can then be requested in two ways: 1) by name, which is useful for finding a specific object, or 2) by index, which is useful for interating through every object.

Definition at line 45 of file BlueprintInstance.h.


Constructor & Destructor Documentation

opal::BlueprintInstance::BlueprintInstance  ) 
 

Definition at line 45 of file BlueprintInstance.cpp.

opal::BlueprintInstance::~BlueprintInstance  )  [virtual]
 

Definition at line 50 of file BlueprintInstance.cpp.

References mJointList, mJointMap, mMotorList, mMotorMap, mSensorList, mSensorMap, mSolidList, and mSolidMap.


Member Function Documentation

Joint * opal::BlueprintInstance::detachJoint unsigned int  i  )  [virtual]
 

Detachs a Joint by index and returns its pointer.

Definition at line 79 of file BlueprintInstance.cpp.

References mJointList, and mJointMap.

Motor * opal::BlueprintInstance::detachMotor unsigned int  i  )  [virtual]
 

Detachs a Motor by index and returns its pointer.

Definition at line 111 of file BlueprintInstance.cpp.

References mMotorList, and mMotorMap.

Sensor * opal::BlueprintInstance::detachSensor unsigned int  i  )  [virtual]
 

Detachs a Sensor by index and returns its pointer.

Definition at line 95 of file BlueprintInstance.cpp.

References mSensorList, and mSensorMap.

virtual OPAL_DECL Solid* OPAL_CALL opal::BlueprintInstance::detachSolid const std::string &  name  )  [virtual]
 

Removes but does not delete the solid.

Note:
make sure solid is stored here

Solid * opal::BlueprintInstance::detachSolid unsigned int  i  )  [virtual]
 

Removes but does not delete the solid.

Note:
make sure i is in the range of solid list

Definition at line 63 of file BlueprintInstance.cpp.

References mSolidList, and mSolidMap.

Joint * opal::BlueprintInstance::getJoint unsigned int  i  )  const [virtual]
 

Finds a Joint by index and returns its pointer.

Note:
this changes the index order

Definition at line 233 of file BlueprintInstance.cpp.

References mJointList.

virtual OPAL_DECL Joint* OPAL_CALL opal::BlueprintInstance::getJoint const std::string &  name  )  const [virtual]
 

Finds a Joint by name and returns its pointer. Returns NULL if the name is not found.

Motor * opal::BlueprintInstance::getMotor unsigned int  i  )  const [virtual]
 

Finds a Motor by index and returns its pointer.

Note:
this changes the index order

Definition at line 238 of file BlueprintInstance.cpp.

References mMotorList.

virtual OPAL_DECL Motor* OPAL_CALL opal::BlueprintInstance::getMotor const std::string &  name  )  const [virtual]
 

Finds a Motor by name and returns its pointer. Returns NULL if the name is not found.

unsigned int opal::BlueprintInstance::getNumJoints  )  const [virtual]
 

Returns the number of Joints in this BlueprintInstance.

Definition at line 213 of file BlueprintInstance.cpp.

References mJointList.

unsigned int opal::BlueprintInstance::getNumMotors  )  const [virtual]
 

Returns the number of Motors in this BlueprintInstance.

Definition at line 218 of file BlueprintInstance.cpp.

References mMotorList.

unsigned int opal::BlueprintInstance::getNumSensors  )  const [virtual]
 

Returns the number of Sensors in this BlueprintInstance.

Definition at line 223 of file BlueprintInstance.cpp.

References mSensorList.

unsigned int opal::BlueprintInstance::getNumSolids  )  const [virtual]
 

Returns the number of Solids in this BlueprintInstance.

Definition at line 208 of file BlueprintInstance.cpp.

References mSolidList.

Sensor * opal::BlueprintInstance::getSensor unsigned int  i  )  const [virtual]
 

Finds a Sensor by index and returns its pointer.

Note:
this changes the index order

Definition at line 243 of file BlueprintInstance.cpp.

References mSensorList.

virtual OPAL_DECL Sensor* OPAL_CALL opal::BlueprintInstance::getSensor const std::string &  name  )  const [virtual]
 

Finds a Sensor by name and returns its pointer. Returns NULL if the name is not found.

Solid * opal::BlueprintInstance::getSolid unsigned int  i  )  const [virtual]
 

Finds a Solid by index and returns its pointer.

Note:
this changes the index order

Definition at line 228 of file BlueprintInstance.cpp.

References mSolidList.

virtual OPAL_DECL Solid* OPAL_CALL opal::BlueprintInstance::getSolid const std::string &  name  )  const [virtual]
 

Finds a Solid by name and returns its pointer. Returns NULL if the name is not found.

void opal::BlueprintInstance::internal_addJoint Joint j  )  [virtual]
 

Adds a new Joint pointer. If the pointer is non-NULL and the object's name is not an empty string, this also adds the pointer to the Joint map.

Definition at line 267 of file BlueprintInstance.cpp.

References opal::Joint::getName(), and mJointList.

void opal::BlueprintInstance::internal_addMotor Motor m  )  [virtual]
 

Adds a new Motor pointer. If the pointer is non-NULL and the object's name is not an empty string, this also adds the pointer to the Motor map.

Definition at line 286 of file BlueprintInstance.cpp.

References opal::Motor::getName(), and mMotorList.

void opal::BlueprintInstance::internal_addSensor Sensor s  )  [virtual]
 

Adds a new Sensor pointer. If the pointer is non-NULL and the object's name is not an empty string, this also adds the pointer to the Sensor map.

Definition at line 305 of file BlueprintInstance.cpp.

References opal::Sensor::getName(), and mSensorList.

void opal::BlueprintInstance::internal_addSolid Solid s  )  [virtual]
 

Adds a new Solid pointer to the list. If the pointer is non-NULL and the object's name is not an empty string, this also adds the pointer to the Solid map.

Definition at line 248 of file BlueprintInstance.cpp.

References opal::Solid::getName(), and mSolidList.


Member Data Documentation

std::vector<Joint*> opal::BlueprintInstance::mJointList [private]
 

List of Joint pointers.

Definition at line 166 of file BlueprintInstance.h.

Referenced by detachJoint(), getJoint(), getNumJoints(), internal_addJoint(), and ~BlueprintInstance().

std::map<std::string, Joint*> opal::BlueprintInstance::mJointMap [private]
 

Map of Joint names to Joint pointers.

Definition at line 154 of file BlueprintInstance.h.

Referenced by detachJoint(), and ~BlueprintInstance().

std::vector<Motor*> opal::BlueprintInstance::mMotorList [private]
 

List of Motor pointers.

Definition at line 169 of file BlueprintInstance.h.

Referenced by detachMotor(), getMotor(), getNumMotors(), internal_addMotor(), and ~BlueprintInstance().

std::map<std::string, Motor*> opal::BlueprintInstance::mMotorMap [private]
 

Map of Motor names to Motor pointers.

Definition at line 157 of file BlueprintInstance.h.

Referenced by detachMotor(), and ~BlueprintInstance().

std::vector<Sensor*> opal::BlueprintInstance::mSensorList [private]
 

List of Sensor pointers.

Definition at line 172 of file BlueprintInstance.h.

Referenced by detachSensor(), getNumSensors(), getSensor(), internal_addSensor(), and ~BlueprintInstance().

std::map<std::string, Sensor*> opal::BlueprintInstance::mSensorMap [private]
 

Map of Sensor names to Sensor pointers.

Definition at line 160 of file BlueprintInstance.h.

Referenced by detachSensor(), and ~BlueprintInstance().

std::vector<Solid*> opal::BlueprintInstance::mSolidList [private]
 

List of Solid pointers.

Definition at line 163 of file BlueprintInstance.h.

Referenced by detachSolid(), getNumSolids(), getSolid(), internal_addSolid(), and ~BlueprintInstance().

std::map<std::string, Solid*> opal::BlueprintInstance::mSolidMap [private]
 

Map of Solid names to Solid pointers.

Definition at line 151 of file BlueprintInstance.h.

Referenced by detachSolid(), and ~BlueprintInstance().


The documentation for this class was generated from the following files:
Generated on Tue May 16 17:49:55 2006 for OPAL by  doxygen 1.4.6-NO