helics  3.0.1
Inputs.hpp
1 /*
2 Copyright (c) 2017-2021,
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 "Federate.hpp"
10 #include "HelicsPrimaryTypes.hpp"
11 #include "helicsTypes.hpp"
12 
13 #include <memory>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
18 namespace units {
19 class precise_unit;
20 } // namespace units
21 
22 namespace helics {
23 
24 class ValueFederate;
25 enum MultiInputHandlingMethod : uint16_t {
27  VECTORIZE_OPERATION = HELICS_MULTI_INPUT_VECTORIZE_OPERATION,
28  AND_OPERATION = HELICS_MULTI_INPUT_AND_OPERATION,
29  OR_OPERATION = HELICS_MULTI_INPUT_OR_OPERATION,
30  SUM_OPERATION = HELICS_MULTI_INPUT_SUM_OPERATION,
31  DIFF_OPERATION = HELICS_MULTI_INPUT_DIFF_OPERATION,
32  MAX_OPERATION = HELICS_MULTI_INPUT_MAX_OPERATION,
33  MIN_OPERATION = HELICS_MULTI_INPUT_MIN_OPERATION,
34  AVERAGE_OPERATION = HELICS_MULTI_INPUT_AVERAGE_OPERATION
35 };
36 
38 class HELICS_CXX_EXPORT Input: public Interface {
39  protected:
40  ValueFederate* fed = nullptr;
41  private:
42  int referenceIndex{-1};
43  void* dataReference{nullptr};
44 
46  DataType injectionType{
48  bool changeDetectionEnabled{false};
49  bool hasUpdate{false};
50  bool disableAssign{false};
51  bool useThreshold{false};
52  bool multiUnits{false};
53  MultiInputHandlingMethod inputVectorOp{
54  MultiInputHandlingMethod::NO_OP};
55  int32_t prevInputCount{0};
56  size_t customTypeHash{0U};
57  defV lastValue{invalidDouble};
58  std::shared_ptr<units::precise_unit> outputUnits;
59  std::shared_ptr<units::precise_unit> inputUnits;
60  std::vector<std::pair<DataType, std::shared_ptr<units::precise_unit>>>
61  sourceTypes;
62  std::string givenTarget;
63  double delta{-1.0};
64  double threshold{0.0};
65  // this needs to match the defV type
66  std::variant<std::function<void(const double&, Time)>,
67  std::function<void(const int64_t&, Time)>,
68  std::function<void(const std::string&, Time)>,
69  std::function<void(const std::complex<double>&, Time)>,
70  std::function<void(const std::vector<double>&, Time)>,
71  std::function<void(const std::vector<std::complex<double>>&, Time)>,
72  std::function<void(const NamedPoint&, Time)>,
73  std::function<void(const bool&, Time)>,
74  std::function<void(const Time&, Time)>>
75  value_callback;
76  public:
78  Input() = default;
80  Input(ValueFederate* valueFed,
81  InterfaceHandle id,
82  const std::string& actName,
83  const std::string& unitsOut = std::string{});
84 
85  Input(ValueFederate* valueFed,
86  const std::string& key,
87  const std::string& defaultType = "def",
88  const std::string& units = std::string{});
89 
90  template<class FedPtr>
91  Input(FedPtr& valueFed,
92  const std::string& key,
93  const std::string& defaultType = "def",
94  const std::string& units = std::string{}):
95  Input(std::addressof(*valueFed), key, defaultType, units)
96  {
97  static_assert(
98  std::is_base_of<ValueFederate, std::remove_reference_t<decltype(*valueFed)>>::value,
99  "first argument must be a pointer to a ValueFederate");
100  }
101 
102  Input(InterfaceVisibility locality,
103  ValueFederate* valueFed,
104  const std::string& key,
105  const std::string& defaultType = "def",
106  const std::string& units = std::string{});
107 
108  template<class FedPtr>
109  Input(InterfaceVisibility locality,
110  FedPtr& valueFed,
111  const std::string& key,
112  const std::string& defaultType = "def",
113  const std::string& units = std::string{}):
114  Input(locality, std::addressof(*valueFed), key, defaultType, units)
115  {
116  static_assert(
117  std::is_base_of<ValueFederate, std::remove_reference_t<decltype(*valueFed)>>::value,
118  "first argument must be a pointer to a ValueFederate");
119  }
120 
121  Input(ValueFederate* valueFed,
122  const std::string& key,
123  DataType defType,
124  const std::string& units = std::string{}):
125  Input(valueFed, key, typeNameStringRef(defType), units)
126  {
127  }
128 
129  template<class FedPtr>
130  Input(FedPtr& valueFed,
131  const std::string& key,
132  DataType defType,
133  const std::string& units = std::string()):
134  Input(valueFed, key, typeNameStringRef(defType), units)
135  {
136  }
137 
138  Input(InterfaceVisibility locality,
139  ValueFederate* valueFed,
140  const std::string& key,
141  const std::string& units = std::string{}):
142  Input(locality, valueFed, key, "def", units)
143  {
144  }
145 
146  template<class FedPtr>
147  Input(InterfaceVisibility locality,
148  FedPtr& valueFed,
149  const std::string& key,
150  const std::string& units = std::string{}):
151  Input(locality, valueFed, key, "def", units)
152  {
153  }
154 
155  Input(InterfaceVisibility locality,
156  ValueFederate* valueFed,
157  const std::string& key,
158  DataType defType,
159  const std::string& units = std::string{}):
160  Input(locality, valueFed, key, typeNameStringRef(defType), units)
161  {
162  }
163 
164  template<class FedPtr>
165  Input(InterfaceVisibility locality,
166  FedPtr& valueFed,
167  const std::string& key,
168  DataType defType,
169  const std::string& units = std::string{}):
170  Input(locality, valueFed, key, typeNameStringRef(defType), units)
171  {
172  }
173 
177  Time getLastUpdate() const;
178 
184  void registerNotificationCallback(std::function<void(Time)> callback);
185 
187  const std::string& getPublicationType() const
188  {
189  return ((injectionType == DataType::HELICS_UNKNOWN) ||
190  (injectionType == DataType::HELICS_CUSTOM)) ?
191  getInjectionType() :
192  typeNameStringRef(injectionType);
193  }
195  const std::string& getType() const { return getExtractionType(); }
197  const std::string& getUnits() const { return getExtractionUnits(); }
199  void addTarget(const std::string& target);
200 
206  bool checkUpdate(bool assumeUpdate = false);
207 
209  void clearUpdate();
212  bool isUpdated();
220  bool isUpdated() const;
221 
222  virtual void setOption(int32_t option, int32_t value = 1) override;
223  virtual int32_t getOption(int32_t option) const override;
229  template<class X>
230  void setInputNotificationCallback(std::function<void(const X&, Time)> callback)
231  {
232  static_assert(
233  helicsType<X>() != DataType::HELICS_CUSTOM,
234  "callback type must be a primary helics type one of \"double, int64_t, named_point, bool, Time "
235  "std::vector<double>, std::vector<std::complex<double>>, std::complex<double>\"");
236  value_callback = std::move(callback);
237  registerCallback();
238  }
239 
240  private:
241  template<class X>
242  void setDefault_impl(std::integral_constant<int, 0> /*V*/, X&& val)
243  {
245  lastValue = make_valid(std::forward<X>(val));
246  }
247 
248  template<class X>
249  void setDefault_impl(std::integral_constant<int, 1> /*V*/, X&& val)
250  {
251  lastValue = make_valid(std::forward<X>(val));
252  }
253 
254  template<class X>
255  void setDefault_impl(std::integral_constant<int, 2> /*V*/, X&& val)
256  {
257  auto res = ValueConverter<remove_cv_ref<X>>::convert(std::forward<X>(val));
258  lastValue = std::string(res.to_string());
259  setDefaultBytes(res);
260  }
261 
263  void registerCallback();
264 
265  public:
268  template<class X>
269  void setDefault(X&& val)
270  {
271  setDefault_impl<X>(typeCategory<X>(), std::forward<X>(val));
272  }
273 
274  void setDefaultBytes(data_view val);
278  void setMinimumChange(double deltaV) noexcept
279  {
280  // this first check enables change detection if it was disabled via negative delta
281  if (delta < 0.0) {
282  changeDetectionEnabled = true;
283  }
284  delta = deltaV;
285  // the second checks if we should disable from negative delta
286  if (delta < 0.0) {
287  changeDetectionEnabled = false;
288  }
289  }
293  void enableChangeDetection(bool enabled = true) noexcept { changeDetectionEnabled = enabled; }
294 
295  private:
297  void handleCallback(Time time);
298  template<class X>
299  void getValue_impl(std::integral_constant<int, primaryType> /*V*/, X& out);
300 
302  void getValue_impl(std::integral_constant<int, primaryType> /*V*/, char& out)
303  {
304  out = getValueChar();
305  }
306 
308  void getValue_impl(std::integral_constant<int, convertibleType> /*V*/, char& out)
309  {
310  out = getValueChar();
311  }
312 
313  template<class X>
314  void getValue_impl(std::integral_constant<int, convertibleType> /*V*/, X& out)
315  {
316  std::conditional_t<std::is_integral<X>::value,
317  std::conditional_t<std::is_same<X, char>::value, char, int64_t>,
318  double>
319  gval;
320  getValue_impl(std::integral_constant<int, primaryType>(), gval);
321  out = static_cast<X>(gval);
322  }
323 
324  template<class X>
325  void getValue_impl(std::integral_constant<int, nonConvertibleType> /*V*/, X& out)
326  {
327  ValueConverter<X>::interpret(getBytes(), out);
328  }
329 
330  template<class X>
331  X getValue_impl(std::integral_constant<int, primaryType> /*V*/)
332  {
333  X val; // NOLINT
334  getValue_impl(std::integral_constant<int, primaryType>(), val);
335  return val;
336  }
337 
338  template<class X>
339  X getValue_impl(std::integral_constant<int, convertibleType> /*V*/)
340  {
341  std::conditional_t<std::is_integral<X>::value,
342  std::conditional_t<std::is_same<X, char>::value, char, int64_t>,
343  double>
344  gval;
345  getValue_impl(std::integral_constant<int, primaryType>(), gval);
346  return static_cast<X>(gval);
347  }
348 
349  template<class X>
350  X getValue_impl(std::integral_constant<int, nonConvertibleType> /*V*/)
351  {
352  return ValueConverter<X>::interpret(getBytes());
353  }
354 
355  public:
357  int getValue(double* data, int maxsize);
359  int getComplexValue(double* data, int maxsize);
361  int getValue(char* str, int maxsize);
365  template<class X>
366  void getValue(X& out)
367  {
368  getValue_impl<X>(typeCategory<X>(), out);
369  }
372  template<class X>
373  auto getValue()
374  {
375  return getValue_impl<remove_cv_ref<X>>(typeCategory<X>());
376  }
377 
378  template<class X>
379  const X& getValueRef();
381  double getDouble() { return getValue_impl<double>(std::integral_constant<int, primaryType>()); }
383  const std::string& getString() { return getValueRef<std::string>(); }
384 
386  data_view getBytes();
388  size_t getByteCount();
390  size_t getStringSize();
392  size_t getVectorSize();
393 
395  DataType getHelicsType() const { return targetType; }
396 
398  DataType getHelicsInjectionType() const { return injectionType; }
399 
400  MultiInputHandlingMethod getMultiInputMode() const { return inputVectorOp; }
401 
402  bool vectorDataProcess(const std::vector<std::shared_ptr<const SmallBuffer>>& dataV);
403 
404  const std::string& getTarget() const
405  {
406  return (!givenTarget.empty()) ? givenTarget : getSourceTargets();
407  }
408 
409  virtual const std::string& getDisplayName() const override
410  {
411  return (mName.empty()) ? getTarget() : getName();
412  }
413 
414  private:
416  void loadSourceInformation();
418  char getValueChar();
420  bool allowDirectFederateUpdate() const
421  {
422  return hasUpdate && !changeDetectionEnabled &&
423  inputVectorOp == MultiInputHandlingMethod::NO_OP;
424  }
425  data_view checkAndGetFedUpdate();
426  void forceCoreDataUpdate();
427  friend class ValueFederateManager;
428 };
429 
431 HELICS_CXX_EXPORT double
432  doubleExtractAndConvert(const data_view& dv,
433  const std::shared_ptr<units::precise_unit>& inputUnits,
434  const std::shared_ptr<units::precise_unit>& outputUnits);
435 
436 HELICS_CXX_EXPORT void
437  integerExtractAndConvert(defV& store,
438  const data_view& dv,
439  const std::shared_ptr<units::precise_unit>& inputUnits,
440  const std::shared_ptr<units::precise_unit>& outputUnits);
441 
442 template<class X>
443 void Input::getValue_impl(std::integral_constant<int, primaryType> /*V*/, X& out)
444 {
445  auto dv = checkAndGetFedUpdate();
446  if (!dv.empty()) {
447  if (injectionType == DataType::HELICS_UNKNOWN) {
448  loadSourceInformation();
449  }
450 
451  if (injectionType == helics::DataType::HELICS_DOUBLE) {
452  defV val = doubleExtractAndConvert(dv, inputUnits, outputUnits);
453  valueExtract(val, out);
454  } else if (injectionType == helics::DataType::HELICS_INT) {
455  defV val;
456  integerExtractAndConvert(val, dv, inputUnits, outputUnits);
457  valueExtract(val, out);
458  } else {
459  valueExtract(dv, injectionType, out);
460  }
461  if (changeDetectionEnabled) {
462  if (changeDetected(lastValue, out, delta)) {
463  lastValue = make_valid(out);
464  } else {
465  valueExtract(lastValue, out);
466  }
467  } else {
468  lastValue = make_valid(out);
469  }
470  } else {
471  valueExtract(lastValue, out);
472  }
473  hasUpdate = false;
474 }
475 
476 template<class X>
477 inline const X& getValueRefImpl(defV& val)
478 {
479  valueConvert(val, helicsType<X>());
480  return std::get<X>(val);
481 }
482 
483 template<>
484 inline const std::string& getValueRefImpl(defV& val)
485 {
486  // don't convert a named point to a string
487  if ((val.index() == named_point_loc)) {
488  return std::get<NamedPoint>(val).name;
489  }
490  valueConvert(val, DataType::HELICS_STRING);
491  return std::get<std::string>(val);
492 }
493 
494 HELICS_CXX_EXPORT bool checkForNeededCoreRetrieval(std::size_t currentIndex,
495  DataType injectionType,
496  DataType conversion);
497 
498 template<class X>
499 const X& Input::getValueRef()
500 {
501  static_assert(std::is_same<typeCategory<X>, std::integral_constant<int, primaryType>>::value,
502  "calling getValue By ref must be with a primary type");
503  auto dv = checkAndGetFedUpdate();
504  if (!dv.empty()) {
505  if (injectionType == DataType::HELICS_UNKNOWN) {
506  loadSourceInformation();
507  }
508 
509  if (changeDetectionEnabled) {
510  X out;
511  if (injectionType == helics::DataType::HELICS_DOUBLE) {
512  defV val = doubleExtractAndConvert(dv, inputUnits, outputUnits);
513  valueExtract(val, out);
514  } else if (injectionType == helics::DataType::HELICS_INT) {
515  defV val;
516  integerExtractAndConvert(val, dv, inputUnits, outputUnits);
517  valueExtract(val, out);
518  } else {
519  valueExtract(dv, injectionType, out);
520  }
521  if (changeDetected(lastValue, out, delta)) {
522  lastValue = make_valid(std::move(out));
523  }
524  } else {
525  valueExtract(dv, injectionType, lastValue);
526  }
527  } else {
528  if (checkForNeededCoreRetrieval(lastValue.index(),
529  injectionType,
530  helicsType<remove_cv_ref<X>>())) {
531  forceCoreDataUpdate();
532  }
533  }
534 
535  return getValueRefImpl<remove_cv_ref<X>>(lastValue);
536 }
537 } // namespace helics
helics::ValueFederate::getLastUpdateTime
Time getLastUpdateTime(const Input &inp) const
Definition: ValueFederate.cpp:494
helics::Input
Definition: Inputs.hpp:38
helics::defV
std::variant< double, int64_t, std::string, std::complex< double >, std::vector< double >, std::vector< std::complex< double > >, NamedPoint > defV
Definition: HelicsPrimaryTypes.hpp:34
helicsTypes.hpp
helics::ValueFederate::clearUpdate
void clearUpdate(const Input &inp)
Definition: ValueFederate.cpp:642
helics::Input::getDouble
double getDouble()
Definition: Inputs.hpp:381
helics::Input::checkUpdate
bool checkUpdate(bool assumeUpdate=false)
Definition: Inputs.cpp:514
helics::helicsType
constexpr DataType helicsType()
Definition: helicsTypes.hpp:376
helics::InterfaceVisibility
InterfaceVisibility
Definition: helicsTypes.hpp:39
HELICS_MULTI_INPUT_MIN_OPERATION
@ HELICS_MULTI_INPUT_MIN_OPERATION
Definition: helics_enums.h:298
helics::ValueFederate
Definition: application_api/ValueFederate.hpp:25
helics::typeCategory
std::conditional_t< helicsType< remove_cv_ref< X > >() !=DataType::HELICS_CUSTOM, std::integral_constant< int, primaryType >, std::conditional_t< isConvertableType< remove_cv_ref< X > >(), std::integral_constant< int, convertibleType >, std::integral_constant< int, nonConvertibleType > >> typeCategory
Definition: helicsTypes.hpp:551
helics::ValueConverter::interpret
static X interpret(const data_view &block)
Definition: ValueConverter.hpp:132
helics::Input::registerNotificationCallback
void registerNotificationCallback(std::function< void(Time)> callback)
Definition: Inputs.cpp:594
helics::Input::isUpdated
bool isUpdated()
Definition: Inputs.cpp:567
HELICS_MULTI_INPUT_NO_OP
@ HELICS_MULTI_INPUT_NO_OP
Definition: helics_enums.h:283
helics::make_valid
int64_t make_valid(bool obj)
Definition: HelicsPrimaryTypes.hpp:65
HELICS_MULTI_INPUT_VECTORIZE_OPERATION
@ HELICS_MULTI_INPUT_VECTORIZE_OPERATION
Definition: helics_enums.h:285
helics::Input::getStringSize
size_t getStringSize()
Definition: Inputs.cpp:636
helics::Input::setMinimumChange
void setMinimumChange(double deltaV) noexcept
Definition: Inputs.hpp:278
HELICS_MULTI_INPUT_AVERAGE_OPERATION
@ HELICS_MULTI_INPUT_AVERAGE_OPERATION
Definition: helics_enums.h:300
helics::InterfaceHandle
Definition: LocalFederateId.hpp:65
helics::Input::getValue
auto getValue()
Definition: Inputs.hpp:373
helics::Time
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
helics::Input::getLastUpdate
Time getLastUpdate() const
Definition: Inputs.cpp:589
helics::ValueFederate::setDefaultValue
void setDefaultValue(const Input &inp, data_view block)
Definition: ValueFederate.cpp:177
helics::Interface::getInjectionType
const std::string & getInjectionType() const
Definition: Federate.cpp:1440
helics::HELICS_UNKNOWN
@ HELICS_UNKNOWN
unknown state
Definition: CoreTypes.hpp:29
HELICS_MULTI_INPUT_AND_OPERATION
@ HELICS_MULTI_INPUT_AND_OPERATION
Definition: helics_enums.h:287
helics::getTypeFromString
DataType getTypeFromString(std::string_view typeName)
Definition: helicsTypes.cpp:219
helics::data_view
Definition: data_view.hpp:22
helics::vectorNorm
double vectorNorm(const std::vector< double > &vec)
Definition: helicsTypes.cpp:85
helics::DataType
DataType
Definition: helicsTypes.hpp:272
helics::Interface::getInjectionUnits
const std::string & getInjectionUnits() const
Definition: Federate.cpp:1450
helics::Interface
Definition: application_api/Federate.hpp:627
helics::Input::Input
Input()=default
helics::Input::getHelicsInjectionType
DataType getHelicsInjectionType() const
Definition: Inputs.hpp:398
helics::Interface::getOption
virtual int32_t getOption(int32_t option) const
Definition: Federate.cpp:1435
HELICS_MULTI_INPUT_DIFF_OPERATION
@ HELICS_MULTI_INPUT_DIFF_OPERATION
Definition: helics_enums.h:294
helics::changeDetected
bool changeDetected(const defV &prevValue, const std::string &val, double)
Definition: helicsPrimaryTypes.cpp:16
helics::ValueFederate::setInputNotificationCallback
void setInputNotificationCallback(std::function< void(Input &, Time)> callback)
Definition: ValueFederate.cpp:616
helics::Interface::isValid
bool isValid() const
Definition: application_api/Federate.hpp:646
HELICS_HANDLE_OPTION_MULTI_INPUT_HANDLING_METHOD
@ HELICS_HANDLE_OPTION_MULTI_INPUT_HANDLING_METHOD
Definition: helics_enums.h:329
helics::Input::setOption
virtual void setOption(int32_t option, int32_t value=1) override
Definition: Inputs.cpp:549
HELICS_MULTI_INPUT_OR_OPERATION
@ HELICS_MULTI_INPUT_OR_OPERATION
Definition: helics_enums.h:289
helics::ValueFederate::isUpdated
bool isUpdated(const Input &inp) const
Definition: ValueFederate.cpp:489
helics::invalidDouble
constexpr double invalidDouble
defined constant for an invalid value as a double
Definition: helicsTypes.hpp:497
helics::Interface::getExtractionType
const std::string & getExtractionType() const
Definition: Federate.cpp:1445
helics::Input::getVectorSize
size_t getVectorSize()
Definition: Inputs.cpp:670
helics::Input::getType
const std::string & getType() const
Definition: Inputs.hpp:195
HELICS_MULTI_INPUT_MAX_OPERATION
@ HELICS_MULTI_INPUT_MAX_OPERATION
Definition: helics_enums.h:296
helics::Input::getByteCount
size_t getByteCount()
Definition: Inputs.cpp:611
helics::ValueFederate::forceCoreUpdate
bool forceCoreUpdate(Input &inp)
Definition: ValueFederate.cpp:399
helics::Input::getBytes
data_view getBytes()
Definition: Inputs.cpp:630
HELICS_MULTI_INPUT_SUM_OPERATION
@ HELICS_MULTI_INPUT_SUM_OPERATION
Definition: helics_enums.h:291
helics::ValueFederate::registerInput
Input & registerInput(const std::string &name, const std::string &type, const std::string &units=std::string())
Definition: ValueFederate.cpp:114
HelicsPrimaryTypes.hpp
naming a set of types that are interchangeable and recognizable inside the HELICS application API and...
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helics::doubleExtractAndConvert
double doubleExtractAndConvert(const data_view &dv, const std::shared_ptr< units::precise_unit > &inputUnits, const std::shared_ptr< units::precise_unit > &outputUnits)
Definition: Inputs.cpp:747
helics::Input::getUnits
const std::string & getUnits() const
Definition: Inputs.hpp:197
helics::Input::getHelicsType
DataType getHelicsType() const
Definition: Inputs.hpp:395
helics::Input::getComplexValue
int getComplexValue(double *data, int maxsize)
Definition: Inputs.cpp:866
helics::Input::getValue
void getValue(X &out)
Definition: Inputs.hpp:366
helics::ValueFederate::addTarget
void addTarget(const Publication &pub, const std::string &target)
Definition: ValueFederate.cpp:138
helics::valueExtract
void valueExtract(const defV &dv, std::string &val)
Definition: helicsPrimaryTypes.cpp:174
helics::getValue
X getValue(ValueFederate &fed, const std::string &key)
Definition: Subscriptions.hpp:30
helics::typeNameStringRef
const std::string & typeNameStringRef(DataType type)
Definition: helicsTypes.cpp:46
helics::ValueFederate::getInput
const Input & getInput(const std::string &name) const
Definition: ValueFederate.cpp:528
helics::Input::getDisplayName
virtual const std::string & getDisplayName() const override
Definition: Inputs.hpp:409
helics::ValueFederate::getBytes
data_view getBytes(const Input &inp)
Definition: ValueFederate.cpp:394
helics::Input::getOption
virtual int32_t getOption(int32_t option) const override
Definition: Inputs.cpp:559
helics::Input::setDefault
void setDefault(X &&val)
Definition: Inputs.hpp:269
helics::Input::setInputNotificationCallback
void setInputNotificationCallback(std::function< void(const X &, Time)> callback)
Definition: Inputs.hpp:230
helics::Interface::setOption
virtual void setOption(int32_t option, int32_t value=1)
Definition: Federate.cpp:1425
helics::Input::getString
const std::string & getString()
Definition: Inputs.hpp:383
helics::Input::addTarget
void addTarget(const std::string &target)
Definition: Inputs.cpp:622
helics::Input::enableChangeDetection
void enableChangeDetection(bool enabled=true) noexcept
Definition: Inputs.hpp:293
helics::Input::clearUpdate
void clearUpdate()
Definition: Inputs.cpp:583
helics::Input::fed
ValueFederate * fed
reference to the value federate
Definition: Inputs.hpp:40
helics::Input::getPublicationType
const std::string & getPublicationType() const
Definition: Inputs.hpp:187