helics  3.0.1
HelicsPrimaryTypes.hpp
Go to the documentation of this file.
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 "ValueConverter.hpp"
10 #include "helics/helics-config.h"
11 #include "helicsTypes.hpp"
12 #include "helics_cxx_export.h"
13 
14 #include <cmath>
15 #include <complex>
16 #include <cstdint>
17 #include <string>
18 #include <utility>
19 #include <variant>
20 #include <vector>
25 namespace helics {
28 using defV = std::variant<double,
29  int64_t,
30  std::string,
31  std::complex<double>,
32  std::vector<double>,
33  std::vector<std::complex<double>>,
35 
37 enum TypeLocation : decltype(std::declval<defV>().index()) {
38  double_loc = 0U,
39  int_loc = 1U,
40  string_loc = 2U,
41  complex_loc = 3U,
42  vector_loc = 4U,
43  complex_vector_loc = 5U,
44  named_point_loc = 6U
45 };
47 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, const std::string& val, double deltaV);
48 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, std::string_view val, double deltaV);
49 HELICS_CXX_EXPORT bool
50  changeDetected(const defV& prevValue, const std::vector<double>& val, double deltaV);
51 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue,
52  const std::vector<std::complex<double>>& val,
53  double deltaV);
54 HELICS_CXX_EXPORT bool
55  changeDetected(const defV& prevValue, const double* vals, size_t size, double deltaV);
56 HELICS_CXX_EXPORT bool
57  changeDetected(const defV& prevValue, const std::complex<double>& val, double deltaV);
58 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, double val, double deltaV);
59 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, int64_t val, double deltaV);
60 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, Time val, double deltaV);
61 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, const NamedPoint& val, double deltaV);
62 HELICS_CXX_EXPORT bool changeDetected(const defV& prevValue, bool val, double deltaV);
63 
65 inline int64_t make_valid(bool obj)
66 {
67  return (obj) ? 1LL : 0LL;
68 }
69 
71 inline int64_t make_valid(uint64_t val)
72 {
73  return static_cast<int64_t>(val);
74 }
75 inline int64_t make_valid(int16_t val)
76 {
77  return static_cast<int64_t>(val);
78 }
79 inline int64_t make_valid(uint16_t val)
80 {
81  return static_cast<int64_t>(val);
82 }
83 inline int64_t make_valid(char val)
84 {
85  return static_cast<int64_t>(val);
86 }
87 inline int64_t make_valid(unsigned char val)
88 {
89  return static_cast<int64_t>(val);
90 }
91 inline int64_t make_valid(int32_t val)
92 {
93  return static_cast<int64_t>(val);
94 }
95 inline int64_t make_valid(uint32_t val)
96 {
97  return static_cast<int64_t>(val);
98 }
99 inline int64_t make_valid(Time val)
100 {
101  return val.getBaseTimeCode();
102 }
103 
104 inline double make_valid(float val)
105 {
106  return static_cast<double>(val);
107 }
108 
109 inline std::complex<double> make_valid(const std::complex<float>& val)
110 {
111  return {val.real(), val.imag()};
112 }
113 
115 template<class X>
116 decltype(auto) make_valid(X&& obj)
117 {
118  return std::forward<X>(obj);
119 }
121 HELICS_CXX_EXPORT void valueExtract(const defV& dv, std::string& val);
122 
124 HELICS_CXX_EXPORT void valueExtract(const defV& dv, std::complex<double>& val);
125 
127 HELICS_CXX_EXPORT void valueExtract(const defV& dv, std::vector<double>& val);
128 
130 HELICS_CXX_EXPORT void valueExtract(const defV& dv, std::vector<std::complex<double>>& val);
131 
133 HELICS_CXX_EXPORT void valueExtract(const defV& dv, NamedPoint& val);
134 
136 HELICS_CXX_EXPORT void valueExtract(const defV& dv, Time& val);
137 
139 HELICS_CXX_EXPORT void valueExtract(const defV& dv, char& val);
140 
142 HELICS_CXX_EXPORT void valueExtract(const defV& dv, bool& val);
143 
144 HELICS_CXX_EXPORT defV readJsonValue(const data_view& dv);
145 
146 HELICS_CXX_EXPORT void valueExtract(const data_view& dv, DataType baseType, std::string& val);
147 
148 HELICS_CXX_EXPORT void
149  valueExtract(const data_view& dv, DataType baseType, std::vector<double>& val);
150 
151 HELICS_CXX_EXPORT void
152  valueExtract(const data_view& dv, DataType baseType, std::complex<double>& val);
153 
154 HELICS_CXX_EXPORT void
155  valueExtract(const data_view& dv, DataType baseType, std::vector<std::complex<double>>& val);
156 
157 HELICS_CXX_EXPORT void valueExtract(const data_view& dv, DataType baseType, NamedPoint& val);
158 
159 HELICS_CXX_EXPORT void valueExtract(const data_view& dv, DataType baseType, Time& val);
160 
161 HELICS_CXX_EXPORT void valueExtract(const data_view& dv, DataType baseType, bool& val);
162 
163 HELICS_CXX_EXPORT void valueExtract(const data_view& dv, DataType baseType, defV& val);
164 
165 HELICS_CXX_EXPORT void valueExtract(const data_view& dv, DataType baseType, char& val);
166 
168 template<class X>
169 std::enable_if_t<std::is_arithmetic<X>::value && (!std::is_same<X, char>::value)>
170  valueExtract(const defV& dv, X& val)
171 {
172  switch (dv.index()) {
173  case double_loc: // double
174  val = static_cast<X>(std::get<double>(dv));
175  break;
176  case int_loc: // int64_t
177  val = static_cast<X>(std::get<int64_t>(dv));
178  break;
179  case string_loc: // string
180  default: {
181  const auto& v = std::get<std::string>(dv);
182  if (v.find_first_of(".eE[]") == std::string::npos) {
183  val = static_cast<X>(getIntFromString(v));
184  } else {
185  val = static_cast<X>(getDoubleFromString(v));
186  }
187  }
188 
189  break;
190  case complex_loc: // complex
191  {
192  auto& cv = std::get<std::complex<double>>(dv);
193  val = static_cast<X>((cv.imag() != 0.0) ? std::abs(cv) : cv.real());
194  }
195 
196  break;
197  case vector_loc: // vector
198  {
199  const auto& vec = std::get<std::vector<double>>(dv);
200  val = static_cast<X>((vec.size() == 1) ? vec[0] : vectorNorm(vec));
201  break;
202  }
203  case complex_vector_loc: // complex vector
204  {
205  const auto& vec = std::get<std::vector<std::complex<double>>>(dv);
206  double vald{0.0};
207  if (vec.size() == 1) {
208  if (vec[0].imag() == 0.0) {
209  vald = vec[0].real();
210  } else {
211  vald = std::abs(vec[0]);
212  }
213  } else {
214  vald = vectorNorm(vec);
215  }
216  val = static_cast<X>(vald);
217  break;
218  }
219  case named_point_loc: {
220  const auto& np = std::get<NamedPoint>(dv);
221  if (std::isnan(np.value)) {
222  if (np.name.find_first_of(".eE[]") == std::string::npos) {
223  val = static_cast<X>(getIntFromString(np.name));
224  } else {
225  val = static_cast<X>(getDoubleFromString(np.name));
226  }
227  } else {
228  val = static_cast<X>(np.value);
229  }
230  break;
231  }
232  }
233 }
234 
236 template<class X>
237 std::enable_if_t<std::is_arithmetic<X>::value && (!std::is_same<X, char>::value)>
238  valueExtract(const data_view& dv, DataType baseType, X& val)
239 {
240  switch (baseType) {
241  case DataType::HELICS_ANY: {
242  defV val_dv;
243  valueExtract(dv, baseType, val_dv);
244  valueExtract(val_dv, val);
245  break;
246  }
247  case DataType::HELICS_STRING:
248  default: {
250  if (v.find_first_of(".eE[]") == std::string_view::npos) {
251  val = static_cast<X>(getIntFromString(v));
252  } else {
253  val = static_cast<X>(getDoubleFromString(v));
254  }
255  }
256 
257  break;
258  case DataType::HELICS_BOOL:
259  val = static_cast<X>((ValueConverter<std::string_view>::interpret(dv) != "0"));
260  break;
261  case DataType::HELICS_NAMED_POINT: {
262  auto npval = ValueConverter<NamedPoint>::interpret(dv);
263  if (std::isnan(npval.value)) {
264  try {
265  if (npval.name.find_first_of(".eE[]") == std::string::npos) {
266  val = static_cast<X>(getIntFromString(npval.name));
267  } else {
268  val = static_cast<X>(getDoubleFromString(npval.name));
269  }
270  }
271  catch (const std::invalid_argument&) {
272  val = static_cast<X>(
273  invalidValue<
274  std::conditional_t<std::is_integral<X>::value, int64_t, double>>());
275  }
276  } else {
277  val = static_cast<X>(npval.value);
278  }
279 
280  break;
281  }
282  case DataType::HELICS_DOUBLE: {
284  val = static_cast<X>(V);
285  break;
286  }
287  case DataType::HELICS_INT: {
289  val = static_cast<X>(V);
290  break;
291  }
292  case DataType::HELICS_TIME: {
293  Time vtime;
294  vtime.setBaseTimeCode(ValueConverter<int64_t>::interpret(dv));
295  val = std::is_integral<X>::value ? static_cast<X>(vtime.getBaseTimeCode()) :
296  static_cast<X>(static_cast<double>(vtime));
297  break;
298  }
299  case DataType::HELICS_VECTOR: {
300  auto V = ValueConverter<std::vector<double>>::interpret(dv);
301  if (V.size() == 1) {
302  val = static_cast<X>(V[0]);
303  } else {
304  val = static_cast<X>(vectorNorm(V));
305  }
306  break;
307  }
308  case DataType::HELICS_COMPLEX: {
309  auto V = ValueConverter<std::complex<double>>::interpret(dv);
310 
311  val = static_cast<X>((V.imag() != 0) ? std::abs(V) : V.real());
312  break;
313  }
314  case DataType::HELICS_COMPLEX_VECTOR: {
315  auto V = ValueConverter<std::vector<std::complex<double>>>::interpret(dv);
316  if (V.size() == 1) {
317  if (V[0].imag() == 0) {
318  val = static_cast<X>(V[0].real());
319  } else {
320  val = static_cast<X>(std::abs(V[0]));
321  }
322  } else {
323  val = static_cast<X>(vectorNorm(V));
324  }
325 
326  break;
327  }
328  case DataType::HELICS_JSON:
329  valueExtract(readJsonValue(dv), val);
330  break;
331  case DataType::HELICS_CUSTOM:
332  throw(std::invalid_argument("unrecognized helics type"));
333  }
334 }
335 
336 HELICS_CXX_EXPORT void valueConvert(defV& val, DataType newType);
337 
338 } // namespace helics
helics::timeZero
constexpr Time timeZero
Definition: helicsTime.hpp:31
helics::TypeLocation
TypeLocation
Definition: HelicsPrimaryTypes.hpp:37
helicsCoreSendCommand
void helicsCoreSendCommand(HelicsCore core, const char *target, const char *command, HelicsError *err)
Definition: helicsExport.cpp:685
helicsCore.h
Common functions for the HELICS C api.
helics::helicsIntString
std::string helicsIntString(std::int64_t val)
Definition: helicsTypes.cpp:334
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
HELICS_ERROR_USER_ABORT
@ HELICS_ERROR_USER_ABORT
Definition: helics_enums.h:213
HelicsTime
double HelicsTime
Definition: api-data.h:90
helicsCoreClone
HelicsCore helicsCoreClone(HelicsCore core, HelicsError *err)
Definition: helicsExport.cpp:336
helicsGetBuildFlags
const char * helicsGetBuildFlags(void)
Definition: helicsExport.cpp:34
helicsTypes.hpp
HELICS_FALSE
const HelicsBool HELICS_FALSE
Definition: api-data.h:105
helicsCoreFree
void helicsCoreFree(HelicsCore core)
Definition: helicsExport.cpp:853
helics::getFedObject
FedObject * getFedObject(HelicsFederate fed, HelicsError *err) noexcept
Definition: FederateExport.cpp:27
HELICS_TRUE
const HelicsBool HELICS_TRUE
Definition: api-data.h:104
helics::NamedPoint::name
std::string name
the text value for the named point
Definition: helicsTypes.hpp:111
helics::NamedPoint
Definition: helicsTypes.hpp:109
helicsLoadSignalHandlerCallback
void helicsLoadSignalHandlerCallback(HelicsBool(*handler)(int))
Definition: helicsExport.cpp:97
HELICS_SEQUENCING_MODE_ORDERED
@ HELICS_SEQUENCING_MODE_ORDERED
Definition: helics_enums.h:367
helicsErrorClear
void helicsErrorClear(HelicsError *err)
Definition: helicsExport.cpp:57
helicsFederateDestroy
void helicsFederateDestroy(HelicsFederate fed)
Definition: helicsExport.cpp:835
helicsBrokerSetTimeBarrier
void helicsBrokerSetTimeBarrier(HelicsBroker broker, HelicsTime barrierTime, HelicsError *err)
Definition: helicsExport.cpp:547
helics::CoreType
CoreType
Definition: CoreTypes.hpp:36
helics::InvalidIdentifier
Definition: core-exceptions.hpp:38
helics::ValueConverter::interpret
static X interpret(const data_view &block)
Definition: ValueConverter.hpp:132
helicsCoreDestroy
void helicsCoreDestroy(HelicsCore core)
Definition: helicsExport.cpp:847
HelicsError::message
const char * message
Definition: api-data.h:162
helics::HelicsSystemFailure
Definition: core-exceptions.hpp:93
helics::make_valid
int64_t make_valid(bool obj)
Definition: HelicsPrimaryTypes.hpp:65
helics::helicsComplexVectorString
std::string helicsComplexVectorString(const std::vector< std::complex< double >> &val)
Definition: helicsTypes.cpp:354
helicsBrokerClone
HelicsBroker helicsBrokerClone(HelicsBroker broker, HelicsError *err)
Definition: helicsExport.cpp:445
helics::invalidValue
X invalidValue()
Definition: helicsTypes.hpp:491
helics::ValueConverter
Definition: ValueConverter.hpp:98
helicsBrokerIsConnected
HelicsBool helicsBrokerIsConnected(HelicsBroker broker)
Definition: helicsExport.cpp:468
HelicsFederate
void * HelicsFederate
Definition: api-data.h:60
HELICS_ERROR_INVALID_OBJECT
@ HELICS_ERROR_INVALID_OBJECT
Definition: helics_enums.h:230
helics::helicsGetComplexVector
std::vector< std::complex< double > > helicsGetComplexVector(std::string_view val)
Definition: helicsTypes.cpp:381
helics::NamedPoint::value
double value
the data value for the named point
Definition: helicsTypes.hpp:112
helicsCoreSetGlobal
void helicsCoreSetGlobal(HelicsCore core, const char *valueName, const char *value, HelicsError *err)
Definition: helicsExport.cpp:672
helics::BrokerFactory::cleanUpBrokers
size_t cleanUpBrokers()
Definition: BrokerFactory.cpp:269
HELICS_ERROR_REGISTRATION_FAILURE
@ HELICS_ERROR_REGISTRATION_FAILURE
Definition: helics_enums.h:234
helicsFederateFinalize
void helicsFederateFinalize(HelicsFederate fed, HelicsError *err)
Definition: FederateExport.cpp:629
helics::Time
TimeRepresentation< count_time< 9 > > Time
Definition: helicsTime.hpp:27
helicsCoreDataLink
void helicsCoreDataLink(HelicsCore core, const char *source, const char *target, HelicsError *err)
Definition: helicsExport.cpp:492
HELICS_ERROR_CONNECTION_FAILURE
@ HELICS_ERROR_CONNECTION_FAILURE
Definition: helics_enums.h:232
helicsFederateClone
HelicsFederate helicsFederateClone(HelicsFederate fed, HelicsError *err)
Definition: FederateExport.cpp:541
helicsCreateCore
HelicsCore helicsCreateCore(const char *type, const char *name, const char *initString, HelicsError *err)
Definition: helicsExport.cpp:266
HELICS_ERROR_EXTERNAL_TYPE
@ HELICS_ERROR_EXTERNAL_TYPE
Definition: helics_enums.h:209
helics::HELICS_UNKNOWN
@ HELICS_UNKNOWN
unknown state
Definition: CoreTypes.hpp:29
helics::getTypeFromString
DataType getTypeFromString(std::string_view typeName)
Definition: helicsTypes.cpp:219
HELICS_ERROR_INVALID_FUNCTION_CALL
@ HELICS_ERROR_INVALID_FUNCTION_CALL
Definition: helics_enums.h:218
helicsIsCoreTypeAvailable
HelicsBool helicsIsCoreTypeAvailable(const char *type)
Definition: helicsExport.cpp:107
helics::CoreType::DEFAULT
@ DEFAULT
ZMQ if available or UDP.
helics::data_view
Definition: data_view.hpp:22
helicsBrokerSendCommand
void helicsBrokerSendCommand(HelicsBroker broker, const char *target, const char *command, HelicsError *err)
Definition: helicsExport.cpp:520
helicsCoreGetIdentifier
const char * helicsCoreGetIdentifier(HelicsCore core)
Definition: helicsExport.cpp:722
helics::versionString
constexpr auto versionString
Definition: helicsVersion.hpp:16
helicsBrokerFree
void helicsBrokerFree(HelicsBroker broker)
Definition: helicsExport.cpp:863
helics::ConnectionFailure
Definition: core-exceptions.hpp:75
helicsBrokerGetIdentifier
const char * helicsBrokerGetIdentifier(HelicsBroker broker)
Definition: helicsExport.cpp:712
helicsBrokerDisconnect
void helicsBrokerDisconnect(HelicsBroker broker, HelicsError *err)
Definition: helicsExport.cpp:819
helics::vectorNorm
double vectorNorm(const std::vector< double > &vec)
Definition: helicsTypes.cpp:85
helics::DataType
DataType
Definition: helicsTypes.hpp:272
helics::CoreFactory::FindOrCreate
std::shared_ptr< Core > FindOrCreate(CoreType type, const std::string &coreName, std::vector< std::string > args)
Definition: CoreFactory.cpp:189
helics::InvalidFunctionCall
Definition: core-exceptions.hpp:66
helicsCreateCoreFromArgs
HelicsCore helicsCreateCoreFromArgs(const char *type, const char *name, int argc, const char *const *argv, HelicsError *err)
Definition: helicsExport.cpp:301
helicsErrorInitialize
HelicsError helicsErrorInitialize(void)
Definition: helicsExport.cpp:48
helics::InvalidParameter
Definition: core-exceptions.hpp:47
helicsBrokerClearTimeBarrier
void helicsBrokerClearTimeBarrier(HelicsBroker broker)
Definition: helicsExport.cpp:556
helics::helicsDoubleString
std::string helicsDoubleString(double val)
Definition: helicsTypes.cpp:339
helics::Core
Definition: core/Core.hpp:42
helicsGetCompilerVersion
const char * helicsGetCompilerVersion(void)
Definition: helicsExport.cpp:39
helics::CoreType::UNRECOGNIZED
@ UNRECOGNIZED
unknown
helics::RegistrationFailure
Definition: core-exceptions.hpp:84
HELICS_ERROR_OTHER
@ HELICS_ERROR_OTHER
Definition: helics_enums.h:211
helicsCloseLibrary
void helicsCloseLibrary(void)
Definition: helicsExport.cpp:902
helics::changeDetected
bool changeDetected(const defV &prevValue, const std::string &val, double)
Definition: helicsPrimaryTypes.cpp:16
helics::getBrokerObject
BrokerObject * getBrokerObject(HelicsBroker broker, HelicsError *err) noexcept
Definition: helicsExport.cpp:221
HelicsBroker
void * HelicsBroker
Definition: api-data.h:55
helicsCoreGlobalError
void helicsCoreGlobalError(HelicsCore core, int errorCode, const char *errorString, HelicsError *err)
Definition: helicsExport.cpp:574
HELICS_ERROR_INVALID_ARGUMENT
@ HELICS_ERROR_INVALID_ARGUMENT
Definition: helics_enums.h:228
helics::helicsBoolValue
bool helicsBoolValue(std::string_view val)
Definition: helicsTypes.cpp:626
helics::invalidDouble
constexpr double invalidDouble
defined constant for an invalid value as a double
Definition: helicsTypes.hpp:497
helics::helicsVectorString
std::string helicsVectorString(const std::vector< double > &val)
Definition: helicsTypes.cpp:344
helicsCreateBrokerFromArgs
HelicsBroker helicsCreateBrokerFromArgs(const char *type, const char *name, int argc, const char *const *argv, HelicsError *err)
Definition: helicsExport.cpp:412
helics::helicsGetNamedPoint
NamedPoint helicsGetNamedPoint(std::string_view val)
Definition: helicsTypes.cpp:388
helics::BrokerObject
Definition: api_objects.h:43
helics::compiler
constexpr auto compiler
Definition: helicsVersion.hpp:33
helics::getCoreObject
CoreObject * getCoreObject(HelicsCore core, HelicsError *err) noexcept
Definition: helicsExport.cpp:204
helicsCoreDisconnect
void helicsCoreDisconnect(HelicsCore core, HelicsError *err)
Definition: helicsExport.cpp:782
helicsCoreConnect
HelicsBool helicsCoreConnect(HelicsCore core, HelicsError *err)
Definition: helicsExport.cpp:764
helics::CoreObject
Definition: api_objects.h:53
helics::helicsComplexString
std::string helicsComplexString(double real, double imag)
Definition: helicsTypes.cpp:103
HelicsPrimaryTypes.hpp
naming a set of types that are interchangeable and recognizable inside the HELICS application API and...
helicsBrokerIsValid
HelicsBool helicsBrokerIsValid(HelicsBroker broker)
Definition: helicsExport.cpp:459
helicsBrokerMakeConnections
void helicsBrokerMakeConnections(HelicsBroker broker, const char *file, HelicsError *err)
Definition: helicsExport.cpp:609
helics::getIntFromString
std::int64_t getIntFromString(std::string_view val)
Definition: helicsTypes.cpp:462
helicsCreateBroker
HelicsBroker helicsCreateBroker(const char *type, const char *name, const char *initString, HelicsError *err)
Definition: helicsExport.cpp:384
helicsBrokerAddDestinationFilterToEndpoint
void helicsBrokerAddDestinationFilterToEndpoint(HelicsBroker broker, const char *filter, const char *endpoint, HelicsError *err)
Definition: helicsExport.cpp:596
HelicsError
Definition: api-data.h:160
helics
the main namespace for the helics co-simulation library User functions will be in the helics namespac...
Definition: AsyncFedCallInfo.hpp:14
helicsClearSignalHandler
void helicsClearSignalHandler()
Definition: helicsExport.cpp:79
helics::CoreFactory::cleanUpCores
size_t cleanUpCores()
Definition: CoreFactory.cpp:320
HELICS_SEQUENCING_MODE_FAST
@ HELICS_SEQUENCING_MODE_FAST
Definition: helics_enums.h:365
helicsBrokerSetLogFile
void helicsBrokerSetLogFile(HelicsBroker broker, const char *logFileName, HelicsError *err)
Definition: helicsExport.cpp:538
helicsCoreAddSourceFilterToEndpoint
void helicsCoreAddSourceFilterToEndpoint(HelicsCore core, const char *filter, const char *endpoint, HelicsError *err)
Definition: helicsExport.cpp:623
helics::buildFlags
constexpr auto buildFlags
Definition: helicsVersion.hpp:30
helicsAbort
void helicsAbort(int errorCode, const char *errorString)
Definition: helicsExport.cpp:913
HelicsCore
void * HelicsCore
Definition: api-data.h:49
helics::getComplexFromString
std::complex< double > getComplexFromString(std::string_view val)
Definition: helicsTypes.cpp:444
helicsCoreSetReadyToInit
void helicsCoreSetReadyToInit(HelicsCore core, HelicsError *err)
Definition: helicsExport.cpp:755
helicsGetVersion
const char * helicsGetVersion(void)
Definition: helicsExport.cpp:29
helics::valueExtract
void valueExtract(const defV &dv, std::string &val)
Definition: helicsPrimaryTypes.cpp:174
helicsFederateFree
void helicsFederateFree(HelicsFederate fed)
Definition: helicsExport.cpp:873
helicsBrokerAddSourceFilterToEndpoint
void helicsBrokerAddSourceFilterToEndpoint(HelicsBroker broker, const char *filter, const char *endpoint, HelicsError *err)
Definition: helicsExport.cpp:583
helics::BrokerFactory::create
std::shared_ptr< Broker > create(CoreType type, const std::string &configureString)
Definition: BrokerFactory.cpp:98
helics::helicsGetVector
std::vector< double > helicsGetVector(std::string_view val)
Definition: helicsTypes.cpp:374
helicsCoreAddDestinationFilterToEndpoint
void helicsCoreAddDestinationFilterToEndpoint(HelicsCore core, const char *filter, const char *endpoint, HelicsError *err)
Definition: helicsExport.cpp:636
helicsBrokerWaitForDisconnect
HelicsBool helicsBrokerWaitForDisconnect(HelicsBroker broker, int msToWait, HelicsError *err)
Definition: helicsExport.cpp:799
helicsBrokerSetGlobal
void helicsBrokerSetGlobal(HelicsBroker broker, const char *valueName, const char *value, HelicsError *err)
Definition: helicsExport.cpp:507
helics::Broker
Definition: core/Broker.hpp:18
helicsBrokerGlobalError
void helicsBrokerGlobalError(HelicsBroker broker, int errorCode, const char *errorString, HelicsError *err)
Definition: helicsExport.cpp:565
helicsLoadSignalHandler
void helicsLoadSignalHandler()
Definition: helicsExport.cpp:74
helicsCoreIsConnected
HelicsBool helicsCoreIsConnected(HelicsCore core)
Definition: helicsExport.cpp:663
helics::gLocalCoreId
constexpr LocalFederateId gLocalCoreId(-259)
helics::helicsNamedPointString
std::string helicsNamedPointString(const NamedPoint &point)
Definition: helicsTypes.cpp:359
helicsBrokerGetAddress
const char * helicsBrokerGetAddress(HelicsBroker broker)
Definition: helicsExport.cpp:733
ValueConverter.hpp
helicsCoreGetAddress
const char * helicsCoreGetAddress(HelicsCore core)
Definition: helicsExport.cpp:744
helicsCoreMakeConnections
void helicsCoreMakeConnections(HelicsCore core, const char *file, HelicsError *err)
Definition: helicsExport.cpp:649
helicsCoreIsValid
HelicsBool helicsCoreIsValid(HelicsCore core)
Definition: helicsExport.cpp:351
helics::getDoubleFromString
double getDoubleFromString(std::string_view val)
Definition: helicsTypes.cpp:473
HelicsError::error_code
int32_t error_code
Definition: api-data.h:161
helicsCoreSetLogFile
void helicsCoreSetLogFile(HelicsCore core, const char *logFileName, HelicsError *err)
Definition: helicsExport.cpp:703
helicsGetFederateByName
HelicsFederate helicsGetFederateByName(const char *fedName, HelicsError *err)
Definition: helicsExport.cpp:360
helics::HelicsException
Definition: core-exceptions.hpp:18
helicsCoreWaitForDisconnect
HelicsBool helicsCoreWaitForDisconnect(HelicsCore core, int msToWait, HelicsError *err)
Definition: helicsExport.cpp:809
HELICS_ERROR_SYSTEM_FAILURE
@ HELICS_ERROR_SYSTEM_FAILURE
Definition: helics_enums.h:224
helicsBrokerDestroy
void helicsBrokerDestroy(HelicsBroker broker)
Definition: helicsExport.cpp:841
HelicsBool
int HelicsBool
Definition: api-data.h:102
helicsBrokerDataLink
void helicsBrokerDataLink(HelicsBroker broker, const char *source, const char *target, HelicsError *err)
Definition: helicsExport.cpp:479
helics::helicsGetComplex
std::complex< double > helicsGetComplex(std::string_view val)
Definition: helicsTypes.cpp:275