All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstraintImplementationFactory.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_PHYSICS_CONSTRAINTIMPLEMENTATIONFACTORY_H
17 #define SURGSIM_PHYSICS_CONSTRAINTIMPLEMENTATIONFACTORY_H
18 
19 #include <memory>
20 
23 
24 namespace SurgSim
25 {
26 namespace Physics
27 {
28 
29 class ConstraintImplementation;
30 
36 {
37 public:
38 
41 
44 
50  std::shared_ptr<ConstraintImplementation> getImplementation(
51  RepresentationType representationType,
52  SurgSim::Math::MlcpConstraintType constraintType) const;
53 
54 private:
55 
58  void addImplementation(std::shared_ptr<ConstraintImplementation> implementation);
59 
61  std::shared_ptr<ConstraintImplementation>
63 
64 
65 };
66 
67 }; // Physics
68 }; // SurgSim
69 
70 #endif
RepresentationType
Definition: Representation.h:42
Definition: MlcpConstraintType.h:44
~ConstraintImplementationFactory()
Destructor.
Definition: ConstraintImplementationFactory.cpp:34
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...
Definition: ConstraintImplementationFactory.cpp:38
std::shared_ptr< ConstraintImplementation > m_implementations[REPRESENTATION_TYPE_COUNT][SurgSim::Math::MLCP_NUM_CONSTRAINT_TYPES]
Lookup table for constrain implementations.
Definition: ConstraintImplementationFactory.h:62
ConstraintImplementationFactory()
Constructor.
Definition: ConstraintImplementationFactory.cpp:27
void addImplementation(std::shared_ptr< ConstraintImplementation > implementation)
Add an implementation to the internal directory.
Definition: ConstraintImplementationFactory.cpp:55
This class manages ConstraintImplementations, and can be used to look up the correct implementation b...
Definition: ConstraintImplementationFactory.h:35
Definition: Representation.h:52
MlcpConstraintType
Definition: MlcpConstraintType.h:24