WSF
WsfMultiresolutionPlatformComponent.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 (C) 2021 Stellar Science; U.S. Government has Unlimited Rights.
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 WSF_MULTIRESOLUTION_PLATFORM_COMPONENT_HPP
13#define WSF_MULTIRESOLUTION_PLATFORM_COMPONENT_HPP
14
15#include <memory>
16#include <vector>
17
18#include "FidelityRange.hpp"
19#include "UtCloneablePtr.hpp"
20#include "UtOptional.hpp"
21#include "WsfComponent.hpp"
22#include "WsfObject.hpp"
23#include "WsfObjectTypeList.hpp"
24#include "WsfStringId.hpp"
25
26class WsfScenario;
27class UtInputBlock;
28
38template<typename DerivedComponent>
40{
41 static_assert(std::is_base_of<WsfPlatformComponent, DerivedComponent>::value ||
42 std::is_base_of<WsfSignature, DerivedComponent>::value,
43 "WsfMultiresolutionPlatformComponent must be instantiated with a type derived from "
44 "WsfPlatformComponent or WsfSignature");
45
46public:
48
50
51 WsfStringId GetComponentName() const override { return GetNameId(); }
52 const int* GetComponentRoles() const override;
53 void* QueryInterface(int aRole) override;
56
58
59 bool ProcessInput(UtInput& aInput) override;
60 bool PreInitialize(double aSimTime) override;
62
63protected:
67 virtual std::unique_ptr<DerivedComponent> GetModel() const = 0;
70 double GetFidelity() const;
71
72private:
73 double mFidelity = 1.0;
74
75 static constexpr int cMULTIRESOLUTION_COMPONENT_ROLE =
77};
78
79namespace wsf
80{
81namespace multiresolution
82{
84template<typename DerivedComponent>
86{
87 WsfObjectTypeListBaseI* const componentList =
89 auto* const derivedComponentList = dynamic_cast<WsfObjectTypeList<DerivedComponent>*>(componentList);
90 assert(derivedComponentList);
91 return *derivedComponentList;
92}
93} // namespace multiresolution
94} // namespace wsf
95
97
98#endif
WsfComponentT< WsfPlatform > WsfPlatformComponent
A convenient typedef for a platform component.
Definition WsfComponent.hpp:171
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
A base class template for defining multiresolution WsfPlatformComponent types.
Definition WsfMultiresolutionPlatformComponent.hpp:40
bool PreInitialize(double aSimTime) override
Definition WsfMultiresolutionPlatformComponentImpl.hpp:201
WsfMultiresolutionPlatformComponent()
Definition WsfMultiresolutionPlatformComponentImpl.hpp:125
bool ProcessInput(UtInput &aInput) override
Definition WsfMultiresolutionPlatformComponentImpl.hpp:159
static WsfMultiresolutionPlatformComponent< DerivedComponent > * Find(const WsfPlatform &aParent)
Definition WsfMultiresolutionPlatformComponentImpl.hpp:151
double GetFidelity() const
Definition WsfMultiresolutionPlatformComponentImpl.hpp:185
virtual std::unique_ptr< DerivedComponent > GetModel() const =0
WsfStringId GetComponentName() const override
Definition WsfMultiresolutionPlatformComponent.hpp:51
void * QueryInterface(int aRole) override
Definition WsfMultiresolutionPlatformComponentImpl.hpp:140
const int * GetComponentRoles() const override
Definition WsfMultiresolutionPlatformComponentImpl.hpp:133
The interface an object type list must support.
Definition WsfObjectTypeListBase.hpp:38
Definition WsfObjectTypeList.hpp:42
WsfStringId GetNameId() const
Definition WsfObject.hpp:66
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
static WsfScenario & FromInput(UtInput &aInput)
Definition WsfScenario.cpp:1294
WsfObjectTypeListBaseI * GetTypes(const std::string &aTypesKind) const
Returns the type list of the given name, or null if it does not exist.
Definition WsfScenario.cpp:1045
constexpr const char * BaseComponentName()
Definition ComponentNameHelper.hpp:103
WsfObjectTypeList< DerivedComponent > & GetObjectTypeList(UtInput &aInput)
Definition WsfMultiresolutionPlatformComponent.hpp:85
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Definition WsfComponentRoles.hpp:60
Copyrights Multiple, All Rights Reserved