opensurgsim
|
This class manages ConstraintImplementations, and can be used to look up the correct implementation by representation and constraint type. More...
#include <ConstraintImplementationFactory.h>
Public Member Functions | |
ConstraintImplementationFactory () | |
Constructor. | |
~ConstraintImplementationFactory () | |
Destructor. | |
std::shared_ptr< ConstraintImplementation > | getImplementation (std::type_index representationType, ConstraintType constraintType) |
Get the instance of a ConstraintImplementation for a specific representation and constraint type. More... | |
void | addImplementation (std::type_index typeIndex, std::shared_ptr< ConstraintImplementation > implementation) |
Add an implementation to the internal directory. More... | |
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.
void SurgSim::Physics::ConstraintImplementationFactory::addImplementation | ( | std::type_index | typeIndex, |
std::shared_ptr< ConstraintImplementation > | implementation | ||
) |
Add an implementation to the internal directory.
typeIndex | The type of representation associated with the implementation. |
implementation | The ConstraintImplementation to add. |
std::shared_ptr< ConstraintImplementation > SurgSim::Physics::ConstraintImplementationFactory::getImplementation | ( | std::type_index | representationType, |
ConstraintType | constraintType | ||
) |
Get the instance of a ConstraintImplementation for a specific representation and constraint type.
representationType | Type index of the representation. |
constraintType | Type of the constraint. |