opensurgsim
Public Member Functions | 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 <ConstraintImplementationFactory.h>

Public Member Functions

 ConstraintImplementationFactory ()
 Constructor.
 
 ~ConstraintImplementationFactory ()
 Destructor.
 
std::shared_ptr< ConstraintImplementationgetImplementation (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...
 

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.

Member Function Documentation

§ addImplementation()

void SurgSim::Physics::ConstraintImplementationFactory::addImplementation ( std::type_index  typeIndex,
std::shared_ptr< ConstraintImplementation implementation 
)

Add an implementation to the internal directory.

Parameters
typeIndexThe type of representation associated with the implementation.
implementationThe ConstraintImplementation to add.

§ getImplementation()

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.

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

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