All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Physics::ConstraintImplementationFactory Class Reference

This class manages ConstraintImplementations, and can be used to look up the correct implementation by representation and constraint type. More...

#include <SurgSim/Physics/ConstraintImplementationFactory.h>

Public Member Functions

 ConstraintImplementationFactory ()
 Constructor. More...
 
 ~ConstraintImplementationFactory ()
 Destructor. More...
 
std::shared_ptr
< ConstraintImplementation
getImplementation (RepresentationType representationType, SurgSim::Math::MlcpConstraintType constraintType) const
 Get the instance of a ConstraintImplementation for a specific representation and constraint type. More...
 

Private Member Functions

void addImplementation (std::shared_ptr< ConstraintImplementation > implementation)
 Add an implementation to the internal directory. More...
 

Private Attributes

std::shared_ptr
< ConstraintImplementation
m_implementations [REPRESENTATION_TYPE_COUNT][SurgSim::Math::MLCP_NUM_CONSTRAINT_TYPES]
 Lookup table for constrain implementations. More...
 

Detailed Description

This class manages ConstraintImplementations, and can be used to look up the correct implementation by representation and constraint type.

The only maintenance that needs to be done right now when a new ConstraintImplementation is added is to add a call into the constructor.

Constructor & Destructor Documentation

SurgSim::Physics::ConstraintImplementationFactory::ConstraintImplementationFactory ( )

Constructor.

SurgSim::Physics::ConstraintImplementationFactory::~ConstraintImplementationFactory ( )

Destructor.

Member Function Documentation

void SurgSim::Physics::ConstraintImplementationFactory::addImplementation ( std::shared_ptr< ConstraintImplementation implementation)
private

Add an implementation to the internal directory.

Parameters
implementationThe ConstraintImplementation to add.
std::shared_ptr< ConstraintImplementation > SurgSim::Physics::ConstraintImplementationFactory::getImplementation ( RepresentationType  representationType,
SurgSim::Math::MlcpConstraintType  constraintType 
) const

Get the instance of a ConstraintImplementation for a specific representation and constraint type.

Parameters
representationTypeType of the representation.
constraintTypeType of the constraint.
Returns
a pointer to an implementation if the implementation can be found, nullptr otherwise.

Member Data Documentation

std::shared_ptr<ConstraintImplementation> SurgSim::Physics::ConstraintImplementationFactory::m_implementations[REPRESENTATION_TYPE_COUNT][SurgSim::Math::MLCP_NUM_CONSTRAINT_TYPES]
private

Lookup table for constrain implementations.


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