WSF
WsfCommMediumTypes.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 2019 Infoscitex, a DCS 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 WSFCOMMMEDIUMTYPES_HPP
13#define WSFCOMMMEDIUMTYPES_HPP
14
15#include "wsf_export.h"
16
17#include <memory>
18
19#include "WsfCommMedium.hpp"
21#include "WsfObjectTypeList.hpp"
22class WsfScenario;
23
24namespace wsf
25{
26namespace comm
27{
28namespace medium
29{
30
31class Container;
32
39class Types : public WsfObjectTypeList<Medium>
40{
41public:
42 static WSF_EXPORT Types& Get(const WsfScenario& aScenario);
43
44 explicit Types(WsfScenario& aScenario);
45 ~Types() override = default;
46
48 WSF_EXPORT std::shared_ptr<Medium> GetInstance(const std::string& aType) const;
49
54
55 WSF_EXPORT bool LoadMedium(UtInput& aInput, Container& aContainer, bool aIsAdding);
56
57 WSF_EXPORT bool DeleteMedium(UtInput& aInput, Container& aContainer);
58
68 WSF_EXPORT bool AddDefaultMedium(Container& aContainer);
70
71 WSF_EXPORT FactoryManager& GetManager() { return mManager; }
72 WSF_EXPORT const FactoryManager& GetManager() const { return mManager; }
73
74private:
76 std::vector<std::shared_ptr<Medium>> mInstances{};
77
79 FactoryManager mManager;
80};
81
82} // namespace medium
83} // namespace comm
84} // namespace wsf
85
86#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
WsfObjectTypeList(WsfScenario &aScenario, unsigned int aFlags, const std::string &aBlockName)
Definition WsfObjectTypeList.hpp:76
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfCommMediumContainer.hpp:43
Definition WsfCommMediumFactory.hpp:94
~Types() override=default
WSF_EXPORT const FactoryManager & GetManager() const
Definition WsfCommMediumTypes.hpp:72
WSF_EXPORT FactoryManager & GetManager()
Definition WsfCommMediumTypes.hpp:71
WSF_EXPORT bool AddDefaultMedium(Container &aContainer)
Definition WsfCommMediumTypes.cpp:57
WSF_EXPORT std::shared_ptr< Medium > GetInstance(const std::string &aType) const
Returns a instantiated medium being utilized.
Definition WsfCommMediumTypes.cpp:240
WSF_EXPORT bool LoadMedium(UtInput &aInput, Container &aContainer, bool aIsAdding)
Definition WsfCommMediumTypes.cpp:86
Types(WsfScenario &aScenario)
Definition WsfCommMediumTypes.cpp:39
WSF_EXPORT bool DeleteMedium(UtInput &aInput, Container &aContainer)
Definition WsfCommMediumTypes.cpp:202
static WSF_EXPORT Types & Get(const WsfScenario &aScenario)
Definition WsfCommMediumTypes.cpp:33
Definition WsfCommMedium.cpp:31
Definition WsfComm.cpp:34
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved