helics  3.3.0
TranslatorInfo.hpp
1 /*
2 Copyright (c) 2017-2022,
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 {
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 
33  public:
36  std::string_view key_,
37  std::string_view endpointType,
38  std::string_view units):
39  id(handle),
40  key(key_), pub(handle, key_, "any", units), ipt(handle, key_, "any", units),
41  ept(handle, key_, endpointType)
42  {
43  }
44  const GlobalHandle id;
45 
46  const std::string key;
47  uint16_t flags = 0;
48  // there is a 4 byte gap here
49  std::shared_ptr<TranslatorOperator> tranOp;
50 
51  private:
52  PublicationInfo pub;
53  InputInfo ipt;
54  EndpointInfo ept;
55 
56  public:
57  PublicationInfo* getPubInfo() { return &pub; }
58  InputInfo* getInputInfo() { return &ipt; }
59  EndpointInfo* getEndpointInfo() { return &ept; }
60 };
61 } // namespace helics
helics::InputInfo
Definition: InputInfo.hpp:20
helics::EndpointInfo
Definition: EndpointInfo.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::TransInformation
Definition: TranslatorInfo.hpp:20
helics::TranslatorInfo::flags
uint16_t flags
flags for the translator
Definition: TranslatorInfo.hpp:47
helics::TranslatorInfo::tranOp
std::shared_ptr< TranslatorOperator > tranOp
the callback operation of the translator
Definition: TranslatorInfo.hpp:49
helics::TranslatorInfo
Definition: TranslatorInfo.hpp:32
helics::TranslatorInfo::id
const GlobalHandle id
id of the translator
Definition: TranslatorInfo.hpp:44
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::PublicationInfo
Definition: PublicationInfo.hpp:18
helics::TranslatorInfo::key
const std::string key
the identifier of the translator
Definition: TranslatorInfo.hpp:46
helics::GlobalHandle
Definition: GlobalFederateId.hpp:144