WSF
WsfMultiresolutionWrapperMetaModel.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_WRAPPER_META_MODEL_HPP
13#define WSF_MULTIRESOLUTION_WRAPPER_META_MODEL_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 "WsfObjectTypeList.hpp"
23#include "WsfStringId.hpp"
24
25class WsfScenario;
26class UtInputBlock;
27
45template<typename DerivedComponent>
47{
48public:
50 ~WsfMultiresolutionWrapperMetaModel() noexcept override = default;
54
56
57 WsfComponent* CloneComponent() const override;
58 WsfObject* Clone() const override;
59 bool ProcessInput(UtInput& aInput) override;
61
62private:
63 struct ModelWithFidelity
64 {
65 WsfStringId mName;
67 ut::CloneablePtr<DerivedComponent> mComponent;
68 };
69 using Index = typename std::vector<ModelWithFidelity>::size_type;
70
73
74 std::unique_ptr<DerivedComponent> GetModel() const override;
75
77
78
81 bool ProcessModel(UtInputBlock& aInputBlock, Index aModelIndex);
84 std::unique_ptr<DerivedComponent> ProcessComponent(UtInput& aInput,
85 std::unique_ptr<DerivedComponent> aExistingComponent);
91 Index ProcessModelName(UtInputBlock& aInputBlock, ut::optional<bool> aExpectExists = ut::nullopt);
94 std::unique_ptr<DerivedComponent> ProcessComponentType(UtInput& aInput);
97 bool ProcessCommonParameters(UtInput& aInput);
101 void FinalizeModelProcessing(UtInput& aInput, const ModelWithFidelity& aModelWithFidelity);
105 void AffirmDisjointWithFidelityRanges(UtInput& aInput, const ModelWithFidelity& aModelWithFidelity) const;
107
111 ut::optional<Index> ModelIndexForFidelity(double aFidelity) const;
114 ut::optional<Index> ModelIndexWithName(const std::string& aTypeName) const;
115
116 std::vector<ModelWithFidelity> mComponentModels;
120 ut::optional<Index> mDefaultComponentIndex;
121};
122
124
125#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfComponent.hpp:39
WsfMultiresolutionPlatformComponent()
Definition WsfMultiresolutionPlatformComponentImpl.hpp:125
virtual std::unique_ptr< DerivedComponent > GetModel() const =0
A class template for defining multiresolution containers for WsfPlatformComponent types.
Definition WsfMultiresolutionWrapperMetaModel.hpp:47
bool ProcessInput(UtInput &aInput) override
Definition WsfMultiresolutionWrapperMetaModelImpl.hpp:39
WsfComponent * CloneComponent() const override
Definition WsfMultiresolutionWrapperMetaModelImpl.hpp:33
~WsfMultiresolutionWrapperMetaModel() noexcept override=default
WsfObject * Clone() const override
Definition WsfMultiresolutionWrapperMetaModelImpl.hpp:27
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
A range of fidelity values defined by a lower bound and upper bound.
Definition FidelityRange.hpp:26
Copyrights Multiple, All Rights Reserved