![]() |
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... | |
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.
SurgSim::Physics::ConstraintImplementationFactory::ConstraintImplementationFactory | ( | ) |
Constructor.
SurgSim::Physics::ConstraintImplementationFactory::~ConstraintImplementationFactory | ( | ) |
Destructor.
|
private |
Add an implementation to the internal directory.
implementation | The 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.
representationType | Type of the representation. |
constraintType | Type of the constraint. |
|
private |
Lookup table for constrain implementations.