helics  3.3.0
Inputs.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 "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 
45  DataType targetType{DataType::HELICS_UNKNOWN};
46  DataType injectionType{
47  DataType::HELICS_UNKNOWN};
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  std::string_view actName,
83  std::string_view unitsOut = {});
84 
85  Input(ValueFederate* valueFed,
86  std::string_view key,
87  std::string_view defaultType = "def",
88  std::string_view units = {});
89 
90  template<class FedPtr>
91  Input(FedPtr& valueFed,
92  std::string_view key,
93  std::string_view defaultType = "def",
94  std::string_view units = {}):
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  std::string_view key,
105  std::string_view defaultType = "def",
106  std::string_view units = {});
107 
108  template<class FedPtr>
109  Input(InterfaceVisibility locality,
110  FedPtr& valueFed,
111  std::string_view key,
112  std::string_view defaultType = "def",
113  std::string_view units = {}):
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  std::string_view key,
123  DataType defType,
124  std::string_view units = {}):
125  Input(valueFed, key, typeNameStringRef(defType), units)
126  {
127  }
128 
129  template<class FedPtr>
130  Input(FedPtr& valueFed, std::string_view key, DataType defType, std::string_view units = {}):
131  Input(valueFed, key, typeNameStringRef(defType), units)
132  {
133  }
134 
135  Input(InterfaceVisibility locality,
136  ValueFederate* valueFed,
137  std::string_view key,
138  std::string_view units = {}):
139  Input(locality, valueFed, key, "def", units)
140  {
141  }
142 
143  template<class FedPtr>
144  Input(InterfaceVisibility locality,
145  FedPtr& valueFed,
146  std::string_view key,
147  std::string_view units = {}):
148  Input(locality, valueFed, key, "def", units)
149  {
150  }
151 
152  Input(InterfaceVisibility locality,
153  ValueFederate* valueFed,
154  std::string_view key,
155  DataType defType,
156  std::string_view units = {}):
157  Input(locality, valueFed, key, typeNameStringRef(defType), units)
158  {
159  }
160 
161  template<class FedPtr>
162  Input(InterfaceVisibility locality,
163  FedPtr& valueFed,
164  std::string_view key,
165  DataType defType,
166  std::string_view units = {}):
167  Input(locality, valueFed, key, typeNameStringRef(defType), units)
168  {
169  }
170 
174  Time getLastUpdate() const;
175 
181  void registerNotificationCallback(std::function<void(Time)> callback);
182 
184  const std::string& getPublicationType() const
185  {
186  return ((injectionType == DataType::HELICS_UNKNOWN) ||
187  (injectionType == DataType::HELICS_CUSTOM)) ?
188  getInjectionType() :
189  typeNameStringRef(injectionType);
190  }
192  const std::string& getType() const { return getExtractionType(); }
194  const std::string& getUnits() const { return getExtractionUnits(); }
196  void addPublication(std::string_view target);
198  void addTarget(std::string_view target) { addPublication(target); }
204  bool checkUpdate(bool assumeUpdate = false);
205 
207  void clearUpdate();
210  bool isUpdated();
218  bool isUpdated() const;
219 
220  virtual void setOption(int32_t option, int32_t value = 1) override;
221  virtual int32_t getOption(int32_t option) const override;
227  template<class X>
228  void setInputNotificationCallback(std::function<void(const X&, Time)> callback)
229  {
230  static_assert(
231  helicsType<X>() != DataType::HELICS_CUSTOM,
232  "callback type must be a primary helics type one of \"double, int64_t, named_point, bool, Time "
233  "std::vector<double>, std::vector<std::complex<double>>, std::complex<double>\"");
234  value_callback = std::move(callback);
235  registerCallback();
236  }
237 
238  private:
239  template<class X>
240  void setDefault_impl(std::integral_constant<int, 0> /*V*/, X&& val)
241  {
243  lastValue = make_valid(std::forward<X>(val));
244  }
245 
246  template<class X>
247  void setDefault_impl(std::integral_constant<int, 1> /*V*/, X&& val)
248  {
249  lastValue = make_valid(std::forward<X>(val));
250  }
251 
252  template<class X>
253  void setDefault_impl(std::integral_constant<int, 2> /*V*/, X&& val)
254  {
255  auto res = ValueConverter<remove_cv_ref<X>>::convert(std::forward<X>(val));
256  lastValue = std::string(res.to_string());
257  setDefaultBytes(res);
258  }
259 
261  void registerCallback();
262 
263  public:
266  template<class X>
267  void setDefault(X&& val)
268  {
269  setDefault_impl<X>(typeCategory<X>(), std::forward<X>(val));
270  }
271 
272  void setDefaultBytes(data_view val);
276  void setMinimumChange(double deltaV) noexcept
277  {
278  // this first check enables change detection if it was disabled via negative delta
279  if (delta < 0.0) {
280  changeDetectionEnabled = true;
281  }
282  delta = deltaV;
283  // the second checks if we should disable from negative delta
284  if (delta < 0.0) {
285  changeDetectionEnabled = false;
286  }
287  }
291  void enableChangeDetection(bool enabled = true) noexcept { changeDetectionEnabled = enabled; }
292 
293  private:
295  void handleCallback(Time time);
296  template<class X>
297  void getValue_impl(std::integral_constant<int, primaryType> /*V*/, X& out);
298 
300  void getValue_impl(std::integral_constant<int, primaryType> /*V*/, char& out)
301  {
302  out = getValueChar();
303  }
304 
306  void getValue_impl(std::integral_constant<int, convertibleType> /*V*/, char& out)
307  {
308  out = getValueChar();
309  }
310 
311  template<class X>
312  void getValue_impl(std::integral_constant<int, convertibleType> /*V*/, X& out)
313  {
314  std::conditional_t<std::is_integral<X>::value,
315  std::conditional_t<std::is_same<X, char>::value, char, int64_t>,
316  double>
317  gval;
318  getValue_impl(std::integral_constant<int, primaryType>(), gval);
319  out = static_cast<X>(gval);
320  }
321 
322  template<class X>
323  void getValue_impl(std::integral_constant<int, nonConvertibleType> /*V*/, X& out)
324  {
325  ValueConverter<X>::interpret(getBytes(), out);
326  }
327 
328  template<class X>
329  X getValue_impl(std::integral_constant<int, primaryType> /*V*/)
330  {
331  X val; // NOLINT
332  getValue_impl(std::integral_constant<int, primaryType>(), val);
333  return val;
334  }
335 
336  template<class X>
337  X getValue_impl(std::integral_constant<int, convertibleType> /*V*/)
338  {
339  std::conditional_t<std::is_integral<X>::value,
340  std::conditional_t<std::is_same<X, char>::value, char, int64_t>,
341  double>
342  gval;
343  getValue_impl(std::integral_constant<int, primaryType>(), gval);
344  return static_cast<X>(gval);
345  }
346 
347  template<class X>
348  X getValue_impl(std::integral_constant<int, nonConvertibleType> /*V*/)
349  {
350  return ValueConverter<X>::interpret(getBytes());
351  }
352 
353  public:
355  int getValue(double* data, int maxsize);
357  int getComplexValue(double* data, int maxsize);
359  int getValue(char* str, int maxsize);
363  template<class X>
364  void getValue(X& out)
365  {
366  getValue_impl<X>(typeCategory<X>(), out);
367  }
370  template<class X>
371  auto getValue()
372  {
373  return getValue_impl<remove_cv_ref<X>>(typeCategory<X>());
374  }
375 
376  template<class X>
377  const X& getValueRef();
379  double getDouble() { return getValue_impl<double>(std::integral_constant<int, primaryType>()); }
381  const std::string& getString() { return getValueRef<std::string>(); }
382 
384  data_view getBytes();
386  size_t getByteCount();
388  size_t getStringSize();
390  size_t getVectorSize();
391 
393  DataType getHelicsType() const { return targetType; }
394 
396  DataType getHelicsInjectionType() const { return injectionType; }
397 
398  MultiInputHandlingMethod getMultiInputMode() const { return inputVectorOp; }
399 
400  bool vectorDataProcess(const std::vector<std::shared_ptr<const SmallBuffer>>& dataV);
401 
402  const std::string& getTarget() const
403  {
404  return (!givenTarget.empty()) ? givenTarget : getSourceTargets();
405  }
406 
407  virtual const std::string& getDisplayName() const override
408  {
409  return (mName.empty()) ? getTarget() : getName();
410  }
411 
412  private:
414  void loadSourceInformation();
416  char getValueChar();
418  bool allowDirectFederateUpdate() const
419  {
420  return hasUpdate && !changeDetectionEnabled &&
421  inputVectorOp == MultiInputHandlingMethod::NO_OP;
422  }
423  data_view checkAndGetFedUpdate();
424  void forceCoreDataUpdate();
425  friend class ValueFederateManager;
426 };
427 
429 HELICS_CXX_EXPORT double
430  doubleExtractAndConvert(const data_view& dv,
431  const std::shared_ptr<units::precise_unit>& inputUnits,
432  const std::shared_ptr<units::precise_unit>& outputUnits);
433 
434 HELICS_CXX_EXPORT void
435  integerExtractAndConvert(defV& store,
436  const data_view& dv,
437  const std::shared_ptr<units::precise_unit>& inputUnits,
438  const std::shared_ptr<units::precise_unit>& outputUnits);
439 
440 template<class X>
441 void Input::getValue_impl(std::integral_constant<int, primaryType> /*V*/, X& out)
442 {
443  auto dv = checkAndGetFedUpdate();
444  if (!dv.empty()) {
445  if (injectionType == DataType::HELICS_UNKNOWN) {
446  loadSourceInformation();
447  }
448 
449  if (injectionType == helics::DataType::HELICS_DOUBLE) {
450  defV val = doubleExtractAndConvert(dv, inputUnits, outputUnits);
451  valueExtract(val, out);
452  } else if (injectionType == helics::DataType::HELICS_INT) {
453  defV val;
454  integerExtractAndConvert(val, dv, inputUnits, outputUnits);
455  valueExtract(val, out);
456  } else {
457  valueExtract(dv, injectionType, out);
458  }
459  if (changeDetectionEnabled) {
460  if (changeDetected(lastValue, out, delta)) {
461  lastValue = make_valid(out);
462  } else {
463  valueExtract(lastValue, out);
464  }
465  } else {
466  lastValue = make_valid(out);
467  }
468  } else {
469  valueExtract(lastValue, out);
470  }
471  hasUpdate = false;
472 }
473 
474 template<class X>
475 inline const X& getValueRefImpl(defV& val)
476 {
477  valueConvert(val, helicsType<X>());
478  return std::get<X>(val);
479 }
480 
481 template<>
482 inline const std::string& getValueRefImpl(defV& val)
483 {
484  // don't convert a named point to a string
485  if ((val.index() == named_point_loc)) {
486  return std::get<NamedPoint>(val).name;
487  }
488  valueConvert(val, DataType::HELICS_STRING);
489  return std::get<std::string>(val);
490 }
491 
492 HELICS_CXX_EXPORT bool checkForNeededCoreRetrieval(std::size_t currentIndex,
493  DataType injectionType,
494  DataType conversion);
495 
496 template<class X>
497 const X& Input::getValueRef()
498 {
499  static_assert(std::is_same<typeCategory<X>, std::integral_constant<int, primaryType>>::value,
500  "calling getValue By ref must be with a primary type");
501  auto dv = checkAndGetFedUpdate();
502  if (!dv.empty()) {
503  if (injectionType == DataType::HELICS_UNKNOWN) {
504  loadSourceInformation();
505  }
506 
507  if (changeDetectionEnabled) {
508  X out;
509  if (injectionType == helics::DataType::HELICS_DOUBLE) {
510  defV val = doubleExtractAndConvert(dv, inputUnits, outputUnits);
511  valueExtract(val, out);
512  } else if (injectionType == helics::DataType::HELICS_INT) {
513  defV val;
514  integerExtractAndConvert(val, dv, inputUnits, outputUnits);
515  valueExtract(val, out);
516  } else {
517  valueExtract(dv, injectionType, out);
518  }
519  if (changeDetected(lastValue, out, delta)) {
520  lastValue = make_valid(std::move(out));
521  }
522  } else {
523  valueExtract(dv, injectionType, lastValue);
524  }
525  } else {
526  if (checkForNeededCoreRetrieval(lastValue.index(),
527  injectionType,
528  helicsType<remove_cv_ref<X>>())) {
529  forceCoreDataUpdate();
530  }
531  }
532 
533  return getValueRefImpl<remove_cv_ref<X>>(lastValue);
534 }
535 } // namespace helics
helics::ValueFederate::getLastUpdateTime
Time getLastUpdateTime(const Input &inp) const
Definition: ValueFederate.cpp:506
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:655
helics::Input::getDouble
double getDouble()
Definition: Inputs.hpp:379
helics::Input::addPublication
void addPublication(std::string_view target)
Definition: Inputs.cpp:624
helics::Input::checkUpdate
bool checkUpdate(bool assumeUpdate=false)
Definition: Inputs.cpp:516
helics::helicsType
constexpr DataType helicsType()
Definition: helicsTypes.hpp:378
helics::InterfaceVisibility
InterfaceVisibility
Definition: helicsTypes.hpp:40
HELICS_MULTI_INPUT_MIN_OPERATION
@ HELICS_MULTI_INPUT_MIN_OPERATION
Definition: helics_enums.h:314
helics::ValueFederate::addTarget
void addTarget(const Publication &pub, std::string_view target)
Definition: ValueFederate.cpp:134
helics::ValueFederate
Definition: application_api/ValueFederate.hpp:26
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:553
helics::ValueConverter::interpret
static X interpret(const data_view &block)
Definition: ValueConverter.hpp:147
helics::Input::registerNotificationCallback
void registerNotificationCallback(std::function< void(Time)> callback)
Definition: Inputs.cpp:596
helics::Input::isUpdated
bool isUpdated()
Definition: Inputs.cpp:569
HELICS_MULTI_INPUT_NO_OP
@ HELICS_MULTI_INPUT_NO_OP
Definition: helics_enums.h:298
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:300
helics::Input::getStringSize
size_t getStringSize()
Definition: Inputs.cpp:638
helics::Input::setMinimumChange
void setMinimumChange(double deltaV) noexcept
Definition: Inputs.hpp:276
HELICS_MULTI_INPUT_AVERAGE_OPERATION
@ HELICS_MULTI_INPUT_AVERAGE_OPERATION
Definition: helics_enums.h:316
helics::getValue
X getValue(ValueFederate &fed, std::string_view key)
Definition: Subscriptions.hpp:31
helics::InterfaceHandle
Definition: LocalFederateId.hpp:65
helics::Input::getValue
auto getValue()
Definition: Inputs.hpp:371
helics::Time
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
helics::ValueFederate::getInput
const Input & getInput(std::string_view name) const
Definition: ValueFederate.cpp:540
helics::Input::getLastUpdate
Time getLastUpdate() const
Definition: Inputs.cpp:591
helics::ValueFederate::setDefaultValue
void setDefaultValue(const Input &inp, data_view block)
Definition: ValueFederate.cpp:173
helics::Interface::getInjectionType
const std::string & getInjectionType() const
Definition: Federate.cpp:1640
HELICS_MULTI_INPUT_AND_OPERATION
@ HELICS_MULTI_INPUT_AND_OPERATION
Definition: helics_enums.h:302
helics::getTypeFromString
DataType getTypeFromString(std::string_view typeName)
Definition: helicsTypes.cpp:238
helics::data_view
Definition: data_view.hpp:22
helics::vectorNorm
double vectorNorm(const std::vector< double > &vec)
Definition: helicsTypes.cpp:103
helics::DataType
DataType
Definition: helicsTypes.hpp:273
helics::Interface::getInjectionUnits
const std::string & getInjectionUnits() const
Definition: Federate.cpp:1650
helics::Interface
Definition: application_api/Federate.hpp:767
helics::Input::Input
Input()=default
helics::Input::getHelicsInjectionType
DataType getHelicsInjectionType() const
Definition: Inputs.hpp:396
helics::Interface::getOption
virtual int32_t getOption(int32_t option) const
Definition: Federate.cpp:1635
HELICS_MULTI_INPUT_DIFF_OPERATION
@ HELICS_MULTI_INPUT_DIFF_OPERATION
Definition: helics_enums.h:310
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:629
helics::Interface::isValid
bool isValid() const
Definition: application_api/Federate.hpp:786
HELICS_HANDLE_OPTION_MULTI_INPUT_HANDLING_METHOD
@ HELICS_HANDLE_OPTION_MULTI_INPUT_HANDLING_METHOD
Definition: helics_enums.h:346
helics::Input::setOption
virtual void setOption(int32_t option, int32_t value=1) override
Definition: Inputs.cpp:551
HELICS_MULTI_INPUT_OR_OPERATION
@ HELICS_MULTI_INPUT_OR_OPERATION
Definition: helics_enums.h:305
helics::ValueFederate::isUpdated
bool isUpdated(const Input &inp) const
Definition: ValueFederate.cpp:501
helics::invalidDouble
constexpr double invalidDouble
defined constant for an invalid value as a double
Definition: helicsTypes.hpp:499
helics::ValueFederate::registerInput
Input & registerInput(std::string_view name, std::string_view type, std::string_view units=std::string_view{})
Definition: ValueFederate.cpp:113
helics::Interface::getExtractionType
const std::string & getExtractionType() const
Definition: Federate.cpp:1645
helics::Input::getVectorSize
size_t getVectorSize()
Definition: Inputs.cpp:672
helics::Input::getType
const std::string & getType() const
Definition: Inputs.hpp:192
helics::Input::addTarget
void addTarget(std::string_view target)
Definition: Inputs.hpp:198
HELICS_MULTI_INPUT_MAX_OPERATION
@ HELICS_MULTI_INPUT_MAX_OPERATION
Definition: helics_enums.h:312
helics::Input::getByteCount
size_t getByteCount()
Definition: Inputs.cpp:613
helics::ValueFederate::forceCoreUpdate
bool forceCoreUpdate(Input &inp)
Definition: ValueFederate.cpp:411
helics::Input::getBytes
data_view getBytes()
Definition: Inputs.cpp:632
HELICS_MULTI_INPUT_SUM_OPERATION
@ HELICS_MULTI_INPUT_SUM_OPERATION
Definition: helics_enums.h:307
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:749
helics::Input::getUnits
const std::string & getUnits() const
Definition: Inputs.hpp:194
helics::Input::getHelicsType
DataType getHelicsType() const
Definition: Inputs.hpp:393
helics::Input::getComplexValue
int getComplexValue(double *data, int maxsize)
Definition: Inputs.cpp:869
helics::Input::getValue
void getValue(X &out)
Definition: Inputs.hpp:364
helics::valueExtract
void valueExtract(const defV &dv, std::string &val)
Definition: helicsPrimaryTypes.cpp:174
helics::typeNameStringRef
const std::string & typeNameStringRef(DataType type)
Definition: helicsTypes.cpp:58
helics::Input::getDisplayName
virtual const std::string & getDisplayName() const override
Definition: Inputs.hpp:407
helics::ValueFederate::getBytes
data_view getBytes(const Input &inp)
Definition: ValueFederate.cpp:406
helics::Input::getOption
virtual int32_t getOption(int32_t option) const override
Definition: Inputs.cpp:561
helics::Input::setDefault
void setDefault(X &&val)
Definition: Inputs.hpp:267
helics::Input::setInputNotificationCallback
void setInputNotificationCallback(std::function< void(const X &, Time)> callback)
Definition: Inputs.hpp:228
helics::Interface::setOption
virtual void setOption(int32_t option, int32_t value=1)
Definition: Federate.cpp:1630
helics::Input::getString
const std::string & getString()
Definition: Inputs.hpp:381
helics::Input::enableChangeDetection
void enableChangeDetection(bool enabled=true) noexcept
Definition: Inputs.hpp:291
helics::Input::clearUpdate
void clearUpdate()
Definition: Inputs.cpp:585
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:184