| helics 3.6.1

TranslatorInfo.hpp
1 /*
2 Copyright (c) 2017-2025,
3 Battelle Memorial Institute; Lawrence Livermore National Security, LLC; Alliance for Sustainable
4 Energy, LLC. See the top-level NOTICE for additional details. All rights reserved.
5 SPDX-License-Identifier: BSD-3-Clause
6 */
7 #pragma once
8
9 #include "EndpointInfo.hpp"
10 #include "InputInfo.hpp"
11 #include "PublicationInfo.hpp"
12 #include "basic_CoreTypes.hpp"
13
14 #include <memory>
15 #include <string>
16 #include <utility>
17 #include <vector>
18
19 namespace helics {
20 struct TransInformation {
21 GlobalHandle id;
22 std::string key;
23 std::string type;
24 TransInformation() = default;
25 TransInformation(GlobalHandle gid, std::string_view key_, std::string_view type_):
26 id(gid), key(key_), type(type_)
27 {
28 }
29 };
30
32 class TranslatorInfo {
33 public:
35 TranslatorInfo(GlobalHandle handle,
36 std::string_view key_,
37 std::string_view endpointType,
38 std::string_view units):
39 id(handle), key(key_), pub(handle, key_, "any", units), ipt(handle, key_, "any", units),
40 ept(handle, key_, endpointType)
41 {
42 }
43 const GlobalHandle id;
44
45 const std::string key;
46 uint16_t flags = 0;
47 // there is a 4 byte gap here
48 std::shared_ptr<TranslatorOperator> tranOp;
49
50 private:
51 PublicationInfo pub;
52 InputInfo ipt;
53 EndpointInfo ept;
54
55 public:
56 PublicationInfo* getPubInfo() { return &pub; }
57 InputInfo* getInputInfo() { return &ipt; }
58 EndpointInfo* getEndpointInfo() { return &ept; }
59 };
60 } // namespace helics
helics::EndpointInfo
Definition: EndpointInfo.hpp:32
helics::GlobalHandle
Definition: GlobalFederateId.hpp:147
helics::InputInfo
Definition: InputInfo.hpp:20
helics::PublicationInfo
Definition: PublicationInfo.hpp:27
helics::TranslatorInfo
Definition: TranslatorInfo.hpp:32
helics::TranslatorInfo::TranslatorInfo
TranslatorInfo(GlobalHandle handle, std::string_view key_, std::string_view endpointType, std::string_view units)
Definition: TranslatorInfo.hpp:35
helics::TranslatorInfo::id
const GlobalHandle id
id of the translator
Definition: TranslatorInfo.hpp:43
helics::TranslatorInfo::flags
uint16_t flags
flags for the translator
Definition: TranslatorInfo.hpp:46
helics::TranslatorInfo::key
const std::string key
the identifier of the translator
Definition: TranslatorInfo.hpp:45
helics::TranslatorInfo::tranOp
std::shared_ptr< TranslatorOperator > tranOp
the callback operation of the translator
Definition: TranslatorInfo.hpp:48
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::TransInformation
Definition: TranslatorInfo.hpp:20