WSF
P6DofTypeManager.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef P6DOFTYPEMANAGER_H
13#define P6DOFTYPEMANAGER_H
14
15#include "p6dof_export.h"
16
17#include <list>
18#include <string>
19#include <unordered_map>
20
21class P6DofIntegrator;
24class P6DofScenario;
26class UtInput;
27
28// The P6DofTypeManager manages lists of object types.
29class P6DOF_EXPORT P6DofTypeManager
30{
31public:
34
36
37 P6DofTypeManager* Clone() const;
38
39 // TODO -- Determine if this could be handled better. Currently not
40 // sure how to get WSF to initialize correctly without it
42
43 // This reads "p6dof_object_types" input blocks
44 bool ProcessInput(UtInput& aInput);
45
46 // SetIntegrators sets the P6DofIntegrator objects
47 void SetIntegrators(const std::string& aFilename);
48
49 // This registers a mover. All P6dofObjectType objects call this
50 // when being created. It allows the manager to be aware of all
51 // P6dofObjectType objects. It returns false if it fails.
52 bool RegisterObjectType(const std::string& aTypeName, P6DofVehicleType* aObjectTypePtr);
53
54 // This de-registers a mover. This should be called prior to
55 // deleting a P6dofObjectType. It allows the manager to be aware
56 // that the de-registered object is no longer available.
57 void UnregisterObjectType(const std::string& aTypeName);
58
59 // This returns a P6DofVehicleType based on the type name.
60 // Null is returned if an object type with the desired name does not exist
61 const P6DofVehicleType* GetObjectTypeByName(const std::string& aTypeName) const;
62
63 P6DofThrustProducerObject* GetThrustProducerObjectType(const std::string& aTypeName) const;
64
65 bool RegisterThrustProducerObjectType(P6DofThrustProducerObject* aObjectType);
66
67 // Returns true if the type of object exists
68 bool ObjectTypeExists(const std::string& aTypeName) const;
69
70 // Returns true if the name is unique
71 bool ObjectTypeNameIsUnique(const std::string& aTypeName) const;
72
73 // Returns the string representing the engine base type (such as "Jet" or "Ramjet")
74 std::string GetEngineBaseType(const std::string& aTypeName) const;
75
76 // Returns true if the type of object exists
77 bool ThrustProducerObjectTypeExists(const std::string& aTypeName) const;
78
79 // This provides the number of object types currently in the list
80 size_t GetNumberOfObjectTypesInList() const { return mObjectTypeMap.size(); }
81
82 // This returns an integrator of the specified type/name or null if
83 // no such integrator exists
84 const P6DofIntegrator* GetIntegratorByName(const std::string& aTypeName) const;
85
86 // This return the default integrator type name
87 std::string GetDefaultIntegratorName() const { return mDefaultIntegratorName; }
88
89protected:
90 // Type Manager should only be instantiated once, don't allow accidental copies
94 , mScenario(nullptr)
96 {
97 }
98
99 bool ProcessIntegratorsInput(UtInput& aInput);
100
101 std::unordered_map<std::string, P6DofVehicleType*> mObjectTypeMap;
102 std::unordered_map<std::string, P6DofThrustProducerObject*> mThrustProducerTypeMap;
103
105
106 std::unordered_map<std::string, P6DofIntegrator*> mIntegratorMap;
107
108 const static std::string mDefaultIntegratorName;
109};
110
111#endif
Definition P6DofIntegrator.hpp:28
Definition P6DofPilotObject.hpp:37
Definition P6DofScenario.hpp:25
Definition P6DofThrustProducerObject.hpp:34
size_t GetNumberOfObjectTypesInList() const
Definition P6DofTypeManager.hpp:80
P6DofTypeManager * Clone() const
Definition P6DofTypeManager.cpp:67
P6DofTypeManager()
Definition P6DofTypeManager.cpp:38
std::unordered_map< std::string, P6DofVehicleType * > mObjectTypeMap
Definition P6DofTypeManager.hpp:101
std::string GetDefaultIntegratorName() const
Definition P6DofTypeManager.hpp:87
static const std::string mDefaultIntegratorName
Definition P6DofTypeManager.hpp:108
P6DofTypeManager(const P6DofTypeManager &)
Definition P6DofTypeManager.hpp:91
std::unordered_map< std::string, P6DofThrustProducerObject * > mThrustProducerTypeMap
Definition P6DofTypeManager.hpp:102
P6DofScenario * mScenario
Definition P6DofTypeManager.hpp:104
P6DofTypeManager & operator=(const P6DofTypeManager &other)=delete
P6DofScenario * GetP6DofScenario() const
Definition P6DofTypeManager.hpp:41
std::unordered_map< std::string, P6DofIntegrator * > mIntegratorMap
Definition P6DofTypeManager.hpp:106
Definition P6DofVehicleType.hpp:41
Copyrights Multiple, All Rights Reserved