helics  3.0.1
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
helics Namespace Reference

the main namespace for the helics co-simulation library User functions will be in the helics namespace with internal functions possible in a lower level namespace More...

Namespaces

 action_message_def
 
 BrokerFactory
 
 CoreFactory
 

Classes

class  ActionMessage
 
class  AsyncFedCallInfo
 
class  BasicBrokerInfo
 
class  BasicFedInfo
 
class  BasicHandleInfo
 
class  Broker
 
class  BrokerApp
 
class  BrokerBase
 
class  BrokerKeeper
 
class  BrokerObject
 
class  CloneFilterOperation
 
class  CloneOperator
 
class  CloningFilter
 
class  CombinationFederate
 
class  CommonCore
 
class  CommsBroker
 
class  CommsInterface
 
class  ConditionalChangeOnDestroy
 
class  ConnectionFailure
 
class  Core
 
class  CoreApp
 
class  CoreBroker
 
class  CoreFederateInfo
 
class  CoreKeeper
 
class  CoreObject
 
class  CustomMessageOperator
 
class  data_view
 
class  DelayFilterOperation
 
class  DependencyInfo
 
class  EmptyCore
 
class  Endpoint
 
class  EndpointInfo
 
struct  EndpointInformation
 
class  EndpointObject
 
struct  EptInformation
 
class  Federate
 
class  FederateError
 
class  FederateInfo
 
class  FederateState
 
class  FedInfo
 
class  FedObject
 
class  Filter
 
class  FilterCoordinator
 
class  FilterFederate
 
class  FilterFederateManager
 
class  FilterInfo
 
class  FilterObject
 
class  FilterOperations
 
class  FilterOperator
 
class  FirewallFilterOperation
 
class  FirewallOperator
 
class  ForwardingTimeCoordinator
 
class  FunctionExecutionFailure
 
class  GlobalBrokerId
 
class  GlobalFederateId
 
class  GlobalHandle
 
class  HandleManager
 
class  helicsCLI11App
 
class  HelicsConfigJSON
 Define a JSON parser for the config files for CLI11. More...
 
class  HelicsException
 
class  HelicsSystemFailure
 
class  IdentifierId
 
class  Input
 
struct  input_info
 
class  InputInfo
 
class  InputObject
 
class  Interface
 
class  InterfaceHandle
 
class  InterfaceInfo
 
class  InvalidConversion
 
class  InvalidFunctionCall
 
class  InvalidIdentifier
 
class  InvalidParameter
 
struct  iteration_time
 
struct  linkConnection
 
class  LocalFederateId
 
class  Logger
 
class  LoggerManager
 
class  LoggerNoThread
 
class  LoggingCore
 
class  Message
 
class  MessageConditionalOperator
 
class  MessageDataOperator
 
class  MessageDestOperator
 
class  MessageFederate
 
class  MessageFederateManager
 
class  MessageHolder
 
class  MessageTimeOperator
 
class  MessageTimer
 
class  MultiBroker
 
class  NamedPoint
 
class  NetworkBroker
 
class  NetworkBrokerData
 
class  NetworkCommsInterface
 
class  NetworkCore
 
class  NullFilterOperator
 
class  ProfilerBuffer
 
class  Publication
 
struct  publication_info
 
class  PublicationInfo
 
class  PublicationObject
 
class  QueryObject
 
class  RandomDelayFilterOperation
 
class  RandomDropFilterOperation
 
class  RegistrationFailure
 
class  RerouteFilterOperation
 
class  route_id
 
class  SmallBuffer
 
class  tcoptions
 
class  TimeCoordinator
 
class  TimeData
 
class  TimeDependencies
 
class  TimeoutMonitor
 
class  UnknownHandleManager
 
class  ValueConverter
 
class  ValueConverter< std::vector< std::string > >
 
class  ValueFederate
 
class  ValueFederateManager
 
class  VectorSubscription
 
class  VectorSubscription2d
 

Typedefs

using defV = std::variant< double, int64_t, std::string, std::complex< double >, std::vector< double >, std::vector< std::complex< double > >, NamedPoint >
 
using IdentifierType = std::uint32_t
 specify the underlying type used in the identifiers
 
using PublicationId = IdentifierId< IdentifierType, Identifiers::PUBLICATION, invalid_id_value >
 
using InputId = IdentifierId< IdentifierType, Identifiers::INPUT, invalid_id_value >
 
using QueryId = IdentifierId< IdentifierType, Identifiers::QUERY, invalid_id_value >
 
template<typename T >
using remove_cv_ref = std::remove_cv_t< std::remove_reference_t< T > >
 Helper template to remove const volatile references.
 
template<typename X >
using 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 > >>
 
using dvalue = std::variant< double, std::string >
 
using portData = std::vector< std::tuple< int, bool, std::shared_ptr< Broker > >>
 
using activeProtector = gmlc::libguarded::guarded< std::pair< bool, bool > >
 
using Time = TimeRepresentation< count_time< 9 > >
 
using IdentifierBaseType = int32_t
 

Enumerations

enum  random_dists_t : int {
  constant, uniform, bernoulli, binomial,
  geometric, poisson, exponential, gamma,
  weibull, extreme_value, normal, lognormal,
  chi_squared, cauchy, fisher_f, student_t
}
 
enum  FilterTypes {
  CUSTOM = HELICS_FILTER_TYPE_CUSTOM, DELAY = HELICS_FILTER_TYPE_DELAY, RANDOM_DELAY = HELICS_FILTER_TYPE_RANDOM_DELAY, RANDOM_DROP = HELICS_FILTER_TYPE_RANDOM_DROP,
  REROUTE = HELICS_FILTER_TYPE_REROUTE, CLONE = HELICS_FILTER_TYPE_CLONE, FIREWALL = HELICS_FILTER_TYPE_FIREWALL, UNRECOGNIZED = 7
}
 
enum  TypeLocation : decltype(std::declval< defV >().index()) {
  double_loc = 0U, int_loc = 1U, string_loc = 2U, complex_loc = 3U,
  vector_loc = 4U, complex_vector_loc = 5U, named_point_loc = 6U
}
 
enum  Identifiers : char {
  PUBLICATION, INPUT, FILTER, ENDPOINT,
  QUERY
}
 
enum  InterfaceVisibility { LOCAL, GLOBAL }
 
enum  DataType : int {
  HELICS_UNKNOWN = HELICS_DATA_TYPE_UNKNOWN, HELICS_STRING = HELICS_DATA_TYPE_STRING, HELICS_DOUBLE = HELICS_DATA_TYPE_DOUBLE, HELICS_INT = HELICS_DATA_TYPE_INT,
  HELICS_COMPLEX = HELICS_DATA_TYPE_COMPLEX, HELICS_VECTOR = HELICS_DATA_TYPE_VECTOR, HELICS_COMPLEX_VECTOR = HELICS_DATA_TYPE_COMPLEX_VECTOR, HELICS_NAMED_POINT = HELICS_DATA_TYPE_NAMED_POINT,
  HELICS_BOOL = HELICS_DATA_TYPE_BOOLEAN, HELICS_TIME = HELICS_DATA_TYPE_TIME, HELICS_CUSTOM = HELICS_DATA_TYPE_RAW, HELICS_ANY = HELICS_DATA_TYPE_ANY,
  HELICS_JSON = HELICS_DATA_TYPE_JSON, HELICS_MULTI = HELICS_DATA_TYPE_MULTI
}
 
enum  MultiInputHandlingMethod : uint16_t {
  NO_OP = HELICS_MULTI_INPUT_NO_OP, VECTORIZE_OPERATION = HELICS_MULTI_INPUT_VECTORIZE_OPERATION, AND_OPERATION = HELICS_MULTI_INPUT_AND_OPERATION, OR_OPERATION = HELICS_MULTI_INPUT_OR_OPERATION,
  SUM_OPERATION = HELICS_MULTI_INPUT_SUM_OPERATION, DIFF_OPERATION = HELICS_MULTI_INPUT_DIFF_OPERATION, MAX_OPERATION = HELICS_MULTI_INPUT_MAX_OPERATION, MIN_OPERATION = HELICS_MULTI_INPUT_MIN_OPERATION,
  AVERAGE_OPERATION = HELICS_MULTI_INPUT_AVERAGE_OPERATION
}
 
enum  JsonErrorCodes : std::int32_t {
  BAD_REQUEST = 400, FORBIDDEN = 403, NOT_FOUND = 404, METHOD_NOT_ALLOWED = 405,
  TIMEOUT = 408, DISCONNECTED = 410, INTERNAL_ERROR = 500, NOT_IMPLEMENTED = 501,
  BAD_GATEWAY = 502, SERVICE_UNAVAILABLE = 503, GATEWAY_TIMEOUT = 504
}
 
enum  CommandErrorCodes : int {
  lost_server_connection_code = -5, connection_error_code = -2, already_init_error_code = 5, duplicate_federate_name_error_code = 6,
  duplicate_broker_name_error_code = 7, mismatch_broker_key_error_code = 9, max_federate_count_exceeded = 11, max_broker_count_exceeded = 13,
  broker_terminating = 14, multiple_wait_for_current_time_flags = 15
}
 
enum  handle_flag_definitions { mapped_flag = extra_flag1, has_source_filter_flag, has_dest_filter_flag, has_non_cloning_dest_filter_flag = extra_flag4 }
 
enum  operation_state : std::uint8_t { operating = 0, error = 5, disconnected = 10 }
 
enum  connection_state : std::uint8_t {
  connected = 0, init_requested = 1, operating = 2, error = 40,
  request_disconnect = 48, disconnected = 50
}
 
enum  FederateStates {
  HELICS_CREATED, HELICS_INITIALIZING, HELICS_EXECUTING, HELICS_TERMINATING,
  HELICS_ERROR, HELICS_FINISHED, HELICS_UNKNOWN, HELICS_UNKNOWN = HELICS_DATA_TYPE_UNKNOWN
}
 
enum  CoreType : int {
  CoreType::DEFAULT = HELICS_CORE_TYPE_DEFAULT, CoreType::ZMQ = HELICS_CORE_TYPE_ZMQ, CoreType::MPI = HELICS_CORE_TYPE_MPI, CoreType::TEST = HELICS_CORE_TYPE_TEST,
  CoreType::INTERPROCESS = HELICS_CORE_TYPE_INTERPROCESS, CoreType::IPC = HELICS_CORE_TYPE_IPC, CoreType::TCP = HELICS_CORE_TYPE_TCP, CoreType::TCP_SS = HELICS_CORE_TYPE_TCP_SS,
  CoreType::UDP = HELICS_CORE_TYPE_UDP, CoreType::NNG = HELICS_CORE_TYPE_NNG, CoreType::ZMQ_SS = HELICS_CORE_TYPE_ZMQ_SS, CoreType::HTTP = HELICS_CORE_TYPE_HTTP,
  CoreType::WEBSOCKET = HELICS_CORE_TYPE_WEBSOCKET, CoreType::INPROC = HELICS_CORE_TYPE_INPROC, CoreType::NULLCORE = HELICS_CORE_TYPE_NULL, CoreType::EMPTY = HELICS_CORE_TYPE_EMPTY,
  CoreType::UNRECOGNIZED = 22, CoreType::MULTI = 45
}
 
enum  MessageProcessingResult : signed char {
  MessageProcessingResult::CONTINUE_PROCESSING = -2, MessageProcessingResult::DELAY_MESSAGE = -1, MessageProcessingResult::NEXT_STEP = 0, MessageProcessingResult::ITERATING = 2,
  MessageProcessingResult::HALTED = 3, MessageProcessingResult::ERROR_RESULT = 7, REPROCESS_MESSAGE = 8
}
 
enum  IterationResult : signed char { IterationResult::NEXT_STEP = 0, IterationResult::ITERATING = 2, IterationResult::HALTED = 3, IterationResult::ERROR_RESULT = 7 }
 
enum  IterationRequest : signed char { IterationRequest::NO_ITERATIONS = 0, IterationRequest::FORCE_ITERATION = 1, IterationRequest::ITERATE_IF_NEEDED = 2 }
 
enum  InterfaceType : char {
  UNKNOWN = 'u', InterfaceType::PUBLICATION = 'p', InterfaceType::INPUT = 'i', InterfaceType::ENDPOINT = 'e',
  InterfaceType::FILTER = 'f'
}
 
enum  Subqueries : std::uint16_t {
  GENERAL_QUERY = 0, FEDERATE_MAP = 1, CURRENT_TIME_MAP = 2, DEPENDENCY_GRAPH = 3,
  DATA_FLOW_GRAPH = 4, VERSION_ALL = 5, GLOBAL_STATE = 6, GLOBAL_TIME_DEBUGGING = 7,
  GLOBAL_FLUSH = 8, GLOBAL_STATUS = 9
}
 
enum  message_process_result { message_process_result::no_effect = 0, message_process_result::processed, message_process_result::delay_processing }
 
enum  time_state_t : uint8_t {
  initialized = 0, exec_requested_iterative = 1, exec_requested = 2, time_granted = 3,
  time_requested_iterative = 4, time_requested = 5, error = 7
}
 
enum  ConnectionType : uint8_t {
  independent = 0, parent = 1, child = 2, self = 3,
  none = 4
}
 
enum  InterfaceNetworks : char { InterfaceNetworks::LOCAL = 0, InterfaceNetworks::IPV4 = 4, InterfaceNetworks::IPV6 = 6, InterfaceNetworks::ALL = 10 }
 
enum  InterfaceTypes : char {
  InterfaceTypes::TCP = 0, InterfaceTypes::UDP = 1, InterfaceTypes::IP = 2, InterfaceTypes::IPC = 3,
  InterfaceTypes::INPROC = 4
}
 
enum  FederateType : int {
  GENERIC, VALUE, MESSAGE, COMBINATION,
  INVALID
}
 

Functions

template<>
const char * typeNameString< std::vector< SmallBuffer > > ()
 
void cleanupHelicsLibrary ()
 
int getPropertyIndex (std::string val)
 
int getFlagIndex (std::string val)
 
int getOptionIndex (std::string val)
 
int getOptionValue (std::string val)
 
FederateInfo loadFederateInfo (const std::string &configString)
 
std::string generateFullCoreInitString (const FederateInfo &fi)
 
double randDouble (random_dists_t dist, double p1, double p2)
 
std::string newDestGeneration (const std::string &src, const std::string &dest, const std::string &formula)
 
FilterTypes filterTypeFromString (const std::string &filterType) noexcept
 
void addOperations (Filter *filt, FilterTypes type, Core *)
 
Filtermake_filter (FilterTypes type, Federate *mFed, const std::string &name)
 
Filtermake_filter (InterfaceVisibility locality, FilterTypes type, Federate *mFed, const std::string &name)
 
std::unique_ptr< Filtermake_filter (FilterTypes type, Core *cr, const std::string &name)
 
std::unique_ptr< Filtermake_filter (FilterTypes type, CoreApp &cr, const std::string &name)
 
CloningFiltermake_cloning_filter (FilterTypes type, Federate *mFed, const std::string &delivery, const std::string &name)
 
CloningFiltermake_cloning_filter (InterfaceVisibility locality, FilterTypes type, Federate *mFed, const std::string &delivery, const std::string &name)
 
std::unique_ptr< CloningFiltermake_cloning_filter (FilterTypes type, Core *cr, const std::string &delivery, const std::string &name)
 
std::unique_ptr< CloningFiltermake_cloning_filter (FilterTypes type, CoreApp &cr, const std::string &delivery, const std::string &name)
 
bool changeDetected (const defV &prevValue, const std::string &val, double)
 
bool changeDetected (const defV &prevValue, std::string_view val, double)
 
bool changeDetected (const defV &prevValue, bool val, double)
 
bool changeDetected (const defV &prevValue, const std::vector< double > &val, double deltaV)
 
bool changeDetected (const defV &prevValue, const std::vector< std::complex< double >> &val, double deltaV)
 
bool changeDetected (const defV &prevValue, const double *vals, size_t size, double deltaV)
 
bool changeDetected (const defV &prevValue, const std::complex< double > &val, double deltaV)
 
bool changeDetected (const defV &prevValue, double val, double deltaV)
 
bool changeDetected (const defV &prevValue, Time val, double deltaV)
 
bool changeDetected (const defV &prevValue, int64_t val, double deltaV)
 
bool changeDetected (const defV &prevValue, const NamedPoint &val, double deltaV)
 
void valueExtract (const defV &dv, std::string &val)
 
void valueExtract (const defV &dv, std::complex< double > &val)
 
void valueExtract (const defV &dv, std::vector< double > &val)
 
void valueExtract (const defV &dv, std::vector< std::complex< double >> &val)
 
void valueExtract (const defV &dv, NamedPoint &val)
 
void valueExtract (const defV &dv, Time &val)
 
void valueExtract (const defV &dv, char &val)
 
void valueExtract (const defV &dv, bool &val)
 
defV readJsonValue (const data_view &dv)
 
void valueExtract (const data_view &dv, DataType baseType, std::string &val)
 
void valueExtract (const data_view &dv, DataType baseType, std::vector< double > &val)
 
void valueExtract (const data_view &dv, DataType baseType, std::vector< std::complex< double >> &val)
 
void valueExtract (const data_view &dv, DataType baseType, std::complex< double > &val)
 
void valueExtract (const data_view &dv, DataType baseType, NamedPoint &val)
 
void valueExtract (const data_view &dv, DataType baseType, Time &val)
 
void valueExtract (const data_view &dv, DataType baseType, bool &val)
 
void valueExtract (const data_view &dv, DataType baseType, char &val)
 
void valueExtract (const data_view &dv, DataType baseType, defV &val)
 
void valueConvert (defV &val, DataType newType)
 
int64_t make_valid (bool obj)
 
int64_t make_valid (uint64_t val)
 
int64_t make_valid (int16_t val)
 
int64_t make_valid (uint16_t val)
 
int64_t make_valid (char val)
 
int64_t make_valid (unsigned char val)
 
int64_t make_valid (int32_t val)
 
int64_t make_valid (uint32_t val)
 
int64_t make_valid (Time val)
 
double make_valid (float val)
 
std::complex< double > make_valid (const std::complex< float > &val)
 
template<class X >
decltype(auto) make_valid (X &&obj)
 
template<class X >
std::enable_if_t< std::is_arithmetic< X >::value &&(!std::is_same< X, char >::value)> valueExtract (const defV &dv, X &val)
 
template<class X >
std::enable_if_t< std::is_arithmetic< X >::value &&(!std::is_same< X, char >::value)> valueExtract (const data_view &dv, DataType baseType, X &val)
 
const std::string & typeNameStringRef (DataType type)
 
double vectorNorm (const std::vector< double > &vec)
 
double vectorNorm (const double *vec, std::size_t size)
 
double vectorNorm (const std::vector< std::complex< double >> &vec)
 
std::string helicsComplexString (double real, double imag)
 
std::string helicsComplexString (std::complex< double > val)
 
DataType getTypeFromString (std::string_view typeName)
 
std::string_view getCleanedTypeName (std::string_view typeName)
 
const std::regex creg (R"(([+-]?(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?)\s*([+-]\s*(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?)[ji]*)")
 
std::complex< double > helicsGetComplex (std::string_view val)
 
std::string helicsIntString (std::int64_t val)
 
std::string helicsDoubleString (double val)
 
std::string helicsVectorString (const std::vector< double > &val)
 
std::string helicsVectorString (const double *vals, size_t size)
 
std::string helicsComplexVectorString (const std::vector< std::complex< double >> &val)
 
std::string helicsNamedPointString (const NamedPoint &point)
 
std::string helicsNamedPointString (std::string_view pointName, double val)
 
std::vector< double > helicsGetVector (std::string_view val)
 
std::vector< std::complex< double > > helicsGetComplexVector (std::string_view val)
 
NamedPoint helicsGetNamedPoint (std::string_view val)
 
std::complex< double > getComplexFromString (std::string_view val)
 
std::int64_t getIntFromString (std::string_view val)
 
double getDoubleFromString (std::string_view val)
 
void helicsGetVector (std::string_view val, std::vector< double > &data)
 
void helicsGetComplexVector (std::string_view val, std::vector< std::complex< double >> &data)
 
bool helicsBoolValue (std::string_view val)
 
SmallBuffer emptyBlock (DataType outputType, DataType inputType=DataType::HELICS_ANY)
 
SmallBuffer typeConvert (DataType type, double val)
 
SmallBuffer typeConvert (DataType type, int64_t val)
 
SmallBuffer typeConvert (DataType type, std::string_view val)
 
SmallBuffer typeConvert (DataType type, const std::vector< double > &val)
 
SmallBuffer typeConvert (DataType type, const double *vals, size_t size)
 
SmallBuffer typeConvertComplex (DataType type, const double *vals, size_t size)
 
SmallBuffer typeConvert (DataType type, const std::vector< std::complex< double >> &val)
 
SmallBuffer typeConvert (DataType type, const std::complex< double > &val)
 
SmallBuffer typeConvert (DataType type, const NamedPoint &val)
 
SmallBuffer typeConvert (DataType type, std::string_view str, double val)
 
SmallBuffer typeConvert (DataType type, bool val)
 
SmallBuffer typeConvert (DataType type, char val)
 
SmallBuffer typeConvert (DataType type, Time val)
 
template<class X >
constexpr const char * typeNameString ()
 
template<>
constexpr const char * typeNameString< std::vector< std::string > > ()
 
template<>
constexpr const char * typeNameString< std::vector< double > > ()
 
template<>
constexpr const char * typeNameString< std::vector< std::complex< double > > > ()
 
template<>
constexpr const char * typeNameString< double > ()
 
template<>
constexpr const char * typeNameString< float > ()
 
template<>
constexpr const char * typeNameString< bool > ()
 
template<>
constexpr const char * typeNameString< char > ()
 
template<>
constexpr const char * typeNameString< unsigned char > ()
 
template<>
constexpr const char * typeNameString< std::int32_t > ()
 
template<>
constexpr const char * typeNameString< std::uint32_t > ()
 
template<>
constexpr const char * typeNameString< int64_t > ()
 
template<>
constexpr const char * typeNameString< std::uint64_t > ()
 
template<>
constexpr const char * typeNameString< std::complex< float > > ()
 
template<>
constexpr const char * typeNameString< std::complex< double > > ()
 
template<>
constexpr const char * typeNameString< std::string > ()
 
template<>
constexpr const char * typeNameString< NamedPoint > ()
 
constexpr bool isBytesType (DataType type)
 
template<class X >
constexpr DataType helicsType ()
 
template<>
constexpr DataType helicsType< int64_t > ()
 
template<>
constexpr DataType helicsType< bool > ()
 
template<>
constexpr DataType helicsType< std::string > ()
 
template<>
constexpr DataType helicsType< NamedPoint > ()
 
template<>
constexpr DataType helicsType< double > ()
 
template<>
constexpr DataType helicsType< Time > ()
 
template<>
constexpr DataType helicsType< std::complex< double > > ()
 
template<>
constexpr DataType helicsType< std::vector< double > > ()
 
template<>
constexpr DataType helicsType< std::vector< std::complex< double > > > ()
 
template<class X >
constexpr bool isConvertableType ()
 
template<>
constexpr bool isConvertableType< float > ()
 
template<>
constexpr bool isConvertableType< long double > ()
 
template<>
constexpr bool isConvertableType< int32_t > ()
 
template<>
constexpr bool isConvertableType< int16_t > ()
 
template<>
constexpr bool isConvertableType< uint16_t > ()
 
template<>
constexpr bool isConvertableType< char > ()
 
template<>
constexpr bool isConvertableType< unsigned char > ()
 
template<>
constexpr bool isConvertableType< uint64_t > ()
 
template<class X >
invalidValue ()
 
template<>
constexpr double invalidValue< double > ()
 
template<>
constexpr int64_t invalidValue< int64_t > ()
 
template<>
constexpr uint64_t invalidValue< uint64_t > ()
 
template<>
constexpr Time invalidValue< Time > ()
 
template<>
NamedPoint invalidValue< NamedPoint > ()
 
template<>
constexpr std::complex< double > invalidValue< std::complex< double > > ()
 
template<class X >
varMax (const std::vector< defV > &vals)
 
template<class X , class Y , typename OP >
varDiff (const std::vector< defV > &vals, const OP &op)
 
template<class X >
size_t varMaxIndex (const std::vector< defV > &vals, std::function< double(const X &)> op)
 
template<class X >
varMin (const std::vector< defV > &vals)
 
template<class X >
size_t varMinIndex (const std::vector< defV > &vals, std::function< double(const X &)> op)
 
double doubleExtractAndConvert (const data_view &dv, const std::shared_ptr< units::precise_unit > &inputUnits, const std::shared_ptr< units::precise_unit > &outputUnits)
 
void integerExtractAndConvert (defV &store, const data_view &dv, const std::shared_ptr< units::precise_unit > &inputUnits, const std::shared_ptr< units::precise_unit > &outputUnits)
 
bool checkForNeededCoreRetrieval (std::size_t currentIndex, DataType injectionType, DataType conversionType)
 
template<class X >
const X & getValueRefImpl (defV &val)
 
template<>
const std::string & getValueRefImpl (defV &val)
 
SmallBuffer typeConvert (DataType type, const defV &val)
 
std::vector< std::string > vectorizeQueryResult (std::string &&queryres)
 
std::vector< std::string > vectorizeQueryResult (const std::string &queryres)
 
std::vector< int > vectorizeIndexQuery (const std::string &queryres)
 
std::vector< std::string > vectorizeAndSortQueryResult (const std::string &queryres)
 
std::vector< std::string > vectorizeAndSortQueryResult (std::string &&queryres)
 
bool waitForInit (helics::Federate *fed, const std::string &fedName, std::chrono::milliseconds timeout)
 
bool waitForFed (helics::Federate *fed, const std::string &fedName, std::chrono::milliseconds timeout)
 
std::string queryFederateSubscriptions (helics::Federate *fed, const std::string &fedName)
 
template<class X >
getValue (ValueFederate &fed, const std::string &key)
 
template<class X >
void getValue (ValueFederate &fed, const std::string &key, X &obj)
 
time_units timeUnitsFromString (const std::string &unitString)
 
Time loadTimeFromString (const std::string &timeString)
 
Time loadTimeFromString (std::string timeString, time_units defUnits)
 
std::string to_string (CoreType type)
 
CoreType coreTypeFromString (std::string type) noexcept
 
bool isCoreTypeAvailable (CoreType type) noexcept
 
template<class... Us>
void publish (ValueFederate &fed, const std::string &pubName, Us... pargs)
 
int getTypeSize (const std::string &type)
 
bool isBlockSizeValid (int size, const publication_info &pubI)
 
bool allowMultiBroker ()
 
void processOptions (const toml::value &section, const std::function< int(const std::string &)> &optionConversion, const std::function< int(const std::string &)> &valueConversion, const std::function< void(int, int)> &optionAction)
 
void processOptions (const Json::Value &section, const std::function< int(const std::string &)> &optionConversion, const std::function< int(const std::string &)> &valueConversion, const std::function< void(int, int)> &optionAction)
 
void loadTags (const Json::Value &section, const std::function< void(const std::string &, const std::string &)> &tagAction)
 
void loadTags (const toml::value &section, const std::function< void(const std::string &, const std::string &)> &tagAction)
 
template<typename Callable >
void addTargets (const toml::value &section, std::string targetName, Callable callback)
 
template<typename Callable >
void addTargets (const Json::Value &section, std::string targetName, Callable callback)
 
std::string generateJsonQuotedString (const std::string &string)
 
std::string generateJsonErrorResponse (JsonErrorCodes code, const std::string &message)
 
template<std::size_t DataSize>
void swap_bytes (std::uint8_t *data)
 
std::unique_ptr< MessagecreateMessageFromCommand (const ActionMessage &cmd)
 
std::unique_ptr< MessagecreateMessageFromCommand (ActionMessage &&cmd)
 
const char * actionMessageType (action_message_def::action_t action)
 
const char * commandErrorString (int errorCode)
 
std::string errorMessageString (const ActionMessage &command)
 
std::string prettyPrintString (const ActionMessage &command)
 
std::ostream & operator<< (std::ostream &os, const ActionMessage &command)
 
int appendMessage (ActionMessage &m, const ActionMessage &newMessage)
 
void setIterationFlags (ActionMessage &command, IterationRequest iterate)
 
bool operator< (const ActionMessage &cmd, const ActionMessage &cmd2)
 
bool isProtocolCommand (const ActionMessage &command) noexcept
 
bool isPriorityCommand (const ActionMessage &command) noexcept
 
bool isTimingCommand (const ActionMessage &command) noexcept
 
bool isDependencyCommand (const ActionMessage &command) noexcept
 
bool isDisconnectCommand (const ActionMessage &command) noexcept
 
bool isErrorCommand (const ActionMessage &command) noexcept
 
bool isValidCommand (const ActionMessage &command) noexcept
 
const std::string & brokerStateName (BrokerBase::BrokerState state)
 
const std::string & state_string (operation_state state)
 
template<class sizeType , class SizedDataType >
bool isValidIndex (sizeType testSize, const SizedDataType &vec)
 
const std::string & state_string (connection_state state)
 
const std::string & fedStateString (FederateStates state)
 
bool returnableResult (MessageProcessingResult result)
 
std::ostream & operator<< (std::ostream &os, GlobalBrokerId id)
 
std::ostream & operator<< (std::ostream &os, GlobalFederateId id)
 
std::ostream & operator<< (std::ostream &os, GlobalHandle id)
 
constexpr route_id generateRouteId (int32_t route_type_code, int32_t index)
 
constexpr int32_t getRouteTypeCode (route_id rid)
 
std::ostream & operator<< (std::ostream &os, route_id id)
 
HelicsConfigJSONaddJsonConfig (CLI::App *app)
 Add the HELICS JSON configuration processor to the app.
 
constexpr Time operator""_t (long double val)
 
bool checkTypeMatch (const std::string &type1, const std::string &type2, bool strict_match)
 
bool checkUnitMatch (const std::string &unit1, const std::string &unit2, bool strict_match)
 
std::ostream & operator<< (std::ostream &os, LocalFederateId fid)
 
std::ostream & operator<< (std::ostream &os, InterfaceHandle handle)
 
constexpr LocalFederateId gLocalCoreId (-259)
 
void addFederateTags (Json::Value &v, const FederateState *fed)
 
Json::Value generateInterfaceConfig (const helics::HandleManager &hm, const helics::GlobalFederateId &fed)
 
void generateInterfaceConfig (Json::Value &iblock, const helics::HandleManager &hm, const helics::GlobalFederateId &fed)
 
bool operator== (const SmallBuffer &sb1, const SmallBuffer &sb2)
 
bool operator!= (const SmallBuffer &sb1, const SmallBuffer &sb2)
 
std::tuple< FederateStates, MessageProcessingResult, bool > processCoordinatorMessage (ActionMessage &cmd, TimeCoordinator *timeCoord, const FederateStates state, const bool timeGranted_mode, const GlobalFederateId localID)
 
void generateJsonOutputTimeData (Json::Value &output, const TimeData &dep, bool includeAggregates)
 
void generateJsonOutputDependency (Json::Value &output, const DependencyInfo &dep)
 
TimeData generateMinTimeUpstream (const TimeDependencies &dependencies, bool restricted, GlobalFederateId self, GlobalFederateId ignore)
 
TimeData generateMinTimeDownstream (const TimeDependencies &dependencies, bool restricted, GlobalFederateId self, GlobalFederateId ignore)
 
TimeData generateMinTimeTotal (const TimeDependencies &dependencies, bool restricted, GlobalFederateId self, GlobalFederateId ignore)
 
bool loadCores ()
 
constexpr const char * tcodeStr (int tcode)
 
std::string makePortAddress (const std::string &networkInterface, int portNumber)
 
std::pair< std::string, int > extractInterfaceandPort (const std::string &address)
 
std::pair< std::string, std::string > extractInterfaceandPortString (const std::string &address)
 
std::string stripProtocol (const std::string &networkAddress)
 
void removeProtocol (std::string &networkAddress)
 
std::string addProtocol (const std::string &networkAddress, InterfaceTypes interfaceT)
 
void insertProtocol (std::string &networkAddress, InterfaceTypes interfaceT)
 
bool isipv6 (const std::string &address)
 
std::vector< std::string > prioritizeExternalAddresses (std::vector< std::string > high, std::vector< std::string > low)
 
template<class InputIt1 , class InputIt2 >
auto matchcount (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
 
std::string getLocalExternalAddressV4 ()
 
std::string getLocalExternalAddressV4 (const std::string &server)
 
std::string getLocalExternalAddressV6 ()
 
std::string getLocalExternalAddressV6 (const std::string &server)
 
std::string getLocalExternalAddress (const std::string &server)
 
std::string generateMatchingInterfaceAddress (const std::string &server, InterfaceNetworks network)
 
FedObjectgetFedObject (HelicsFederate fed, HelicsError *err) noexcept
 
CoreObjectgetCoreObject (HelicsCore core, HelicsError *err) noexcept
 
BrokerObjectgetBrokerObject (HelicsBroker broker, HelicsError *err) noexcept
 

Variables

constexpr auto bvecstr = "block_vector"
 
constexpr IdentifierType invalid_id_value
 defining an invalid id value More...
 
constexpr double invalidDouble = -1e49
 defined constant for an invalid value as a double
 
constexpr int primaryType = 0
 
constexpr int convertibleType = 1
 
constexpr int nonConvertibleType = 2
 
constexpr auto LEADING_CHAR = '\xF3'
 
constexpr auto TAIL_CHAR1 = '\xFA'
 
constexpr auto TAIL_CHAR2 = '\xFC'
 
constexpr int targetStringLoc {0}
 
constexpr int sourceStringLoc {1}
 
constexpr int unitStringLoc {1}
 
constexpr int origSourceStringLoc {2}
 
constexpr int origDestStringLoc {3}
 
constexpr int typeStringLoc {0}
 
constexpr int typeOutStringLoc {1}
 
constexpr int32_t cmd_info_basis {65536}
 
constexpr char universalKey [] = "**"
 
const std::vector< InterfaceHandleemptyHandles
 
constexpr Time startupTime = Time::minVal()
 
constexpr Time initialTime {-1000000.0}
 
constexpr IdentifierBaseType gGlobalFederateIdShift {0x0002'0000}
 
constexpr IdentifierBaseType gGlobalBrokerIdShift {0x7000'0000}
 
constexpr GlobalBrokerId parent_broker_id {0}
 
constexpr GlobalBrokerId root_broker_id {1}
 
constexpr GlobalFederateId direct_core_id {-235262}
 
constexpr route_id parent_route_id {0}
 
constexpr route_id control_route {-1}
 
constexpr int32_t normal_route_code {0}
 
constexpr int32_t json_route_code {10}
 
constexpr Time timeZero = Time::zeroVal()
 
constexpr Time timeEpsilon = Time::epsilon()
 
constexpr Time negEpsilon = -Time::epsilon()
 
constexpr Time initializationTime = negEpsilon
 
constexpr auto versionString = HELICS_VERSION_STRING
 
constexpr int versionMajor = HELICS_VERSION_MAJOR
 
constexpr int versionMinor = HELICS_VERSION_MINOR
 
constexpr int versionPatch = HELICS_VERSION_PATCH
 
constexpr auto versionBuild = HELICS_VERSION_BUILD
 
constexpr auto buildFlags = HELICS_BUILD_FLAGS_DEBUG
 
constexpr auto compiler = HELICS_COMPILER_VERSION
 
constexpr InterfaceHandle gDirectSendHandle
 this special handle can be used to directly send a message in a core More...
 
constexpr const char * tstr []
 
constexpr const char * defInterface []
 
constexpr const char * defBrokerInterface []
 
constexpr const char * defLocalInterface [] = {"127.0.0.1", "127.0.0.1", "tcp://127.0.0.1", "", ""}
 
constexpr int always_log = -100000
 level that will always log
 
constexpr int log_everything = 100
 level that will log everything
 

Detailed Description

the main namespace for the helics co-simulation library User functions will be in the helics namespace with internal functions possible in a lower level namespace

HELICS Application API

the core namespace for the helics C++ library all user functions are found in this namespace along with many other functions in the Core API

Typedef Documentation

◆ defV

using helics::defV = typedef std::variant<double, int64_t, std::string, std::complex<double>, std::vector<double>, std::vector<std::complex<double> >, NamedPoint>

define a variant with the different types

◆ IdentifierBaseType

using helics::IdentifierBaseType = typedef int32_t

base date type for id types

◆ Time

using helics::Time = typedef TimeRepresentation<count_time<9> >

Simulation virtual time.

Class represents time in the core.

◆ typeCategory

template<typename X >
using helics::typeCategory = typedef 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> >>

template dividing types into 3 categories 0 is primary types 1 types convertible to primary types 2 type not convertible to primary types

Enumeration Type Documentation

◆ connection_state

enum helics::connection_state : std::uint8_t
strong

enumeration of possible states of a remote federate or broker

◆ CoreType

enum helics::CoreType : int
strong

the type of the cores that are available

Enumerator
DEFAULT 

ZMQ if available or UDP.

pick a core type depending on compile configuration usually either

ZMQ 

use the Zero MQ networking protocol

MPI 

use MPI for operation on a parallel cluster

TEST 

use the Test core if all federates are in the same process

INTERPROCESS 

use when all federates are on the same machine

interprocess uses memory mapped files to transfer data (for

IPC 

same as INTERPROCESS

TCP 

use a generic TCP protocol message stream to send messages

TCP_SS 

a single socket version of the TCP core for more easily handling firewalls

UDP 

use UDP packets to send the data

NNG 

reserved for future Nanomsg implementation

ZMQ_SS 

single socket version of ZMQ core for better scalability performance

HTTP 

core/broker using web traffic

WEBSOCKET 

core/broker using web sockets

INPROC 

core/broker using a stripped down in process core type

NULLCORE 

explicit core type that doesn't exist

EMPTY 

core type that does nothing and can't communicate

UNRECOGNIZED 

unknown

MULTI 

use the multi-broker

◆ DataType

enum helics::DataType : int
strong

the base types for helics

◆ FederateStates

enumeration of the possible federate states

Enumerator
HELICS_INITIALIZING 

state upon creation, all registration calls are allowed

the federation has entered initialization state and initial values can be published

HELICS_EXECUTING 

the federation has entered execution state and it now advancing in time

HELICS_TERMINATING 

the federate is in the process of shutting down

HELICS_ERROR 

the federation has encountered an error

HELICS_FINISHED 

the federation has finished its execution

HELICS_UNKNOWN 

unknown state

◆ FederateType

enum helics::FederateType : int
strong

type code embedded in the objects so the library knows how to cast them appropriately

◆ FilterTypes

enum helics::FilterTypes
strong

a set of common defined filters

◆ handle_flag_definitions

define extra flag definitions

Enumerator
has_source_filter_flag 

indicator that an endpoint or message has a source filter

has_dest_filter_flag 

indicator that an endpoint or message has a destination filter

has_non_cloning_dest_filter_flag 

indicator that the endpoint or filter has a destination filter that alters the message

◆ Identifiers

enum helics::Identifiers : char
strong

the known types of identifiers

◆ InterfaceNetworks

enum helics::InterfaceNetworks : char
strong

define the network access

Enumerator
LOCAL 

just open local ports

IPV4 

use external ipv4 ports

IPV6 

use external ipv6 ports

ALL 

use all external ports

◆ InterfaceType

enum helics::InterfaceType : char
strong

define the type of the handle

Enumerator
PUBLICATION 

handle to output interface

INPUT 

handle to a input interface

ENDPOINT 

handle to an endpoint

FILTER 

handle to a filter

◆ InterfaceTypes

enum helics::InterfaceTypes : char
strong

define keys for particular interfaces

Enumerator
TCP 

using tcp ports for communication

UDP 

using udp ports for communication

IP 

using both types of ports (tcp/or udp) for communication

IPC 

using ipc locations

INPROC 

using inproc sockets for communications

◆ InterfaceVisibility

enumeration of locality namespaces

◆ IterationRequest

enum helics::IterationRequest : signed char
strong

enumeration of the possible iteration requests by a federate

Enumerator
NO_ITERATIONS 

indicator that the iterations have completed

FORCE_ITERATION 

force an iteration whether it is needed or not

ITERATE_IF_NEEDED 

indicator that the iterations need to continue

◆ IterationResult

enum helics::IterationResult : signed char
strong

enumeration of the possible states of iteration

Enumerator
NEXT_STEP 

indicator that the iterations have completed and the federate has moved to the next step

ITERATING 

indicator that the iterations need to continue

HALTED 

indicator that the simulation has been halted

ERROR_RESULT 

indicator that an error has occurred

◆ message_process_result

enumeration of possible processing results

Enumerator
no_effect 

the message did not result in an update

processed 

the message was used to update the current state

delay_processing 

the message should be delayed and reprocessed later

◆ MessageProcessingResult

enum helics::MessageProcessingResult : signed char
strong

enumeration of the possible message processing results

Enumerator
CONTINUE_PROCESSING 

the current loop should continue

DELAY_MESSAGE 

delay the current message and continue processing

NEXT_STEP 

indicator that the iterations have completed

ITERATING 

indicator that the iterations need to continue

HALTED 

indicator that the simulation has been halted

ERROR_RESULT 

indicator that an error has occurred

◆ operation_state

enum helics::operation_state : std::uint8_t
strong

enumeration of possible operating conditions for a federate

◆ random_dists_t

enum helics::random_dists_t : int
strong

enumeration of possible random number generator distributions

◆ time_state_t

enum helics::time_state_t : uint8_t
strong

enumeration of possible states for a federate to be in regards to time request

◆ TypeLocation

enum helics::TypeLocation : decltype(std::declval< defV >().index())

enumeration of the index value of the types inside the defV variant

Function Documentation

◆ actionMessageType()

const char * helics::actionMessageType ( action_message_def::action_t  action)

return the name of the action

Parameters
actionThe action to get the name for
Returns
a pointer to string with the name

Referenced by prettyPrintString().

◆ addOperations()

void helics::addOperations ( Filter filt,
FilterTypes  type,
Core  
)

add a defined operation to a filter

Referenced by make_cloning_filter().

◆ addProtocol()

std::string helics::addProtocol ( const std::string &  networkAddress,
InterfaceTypes  interfaceT 
)

add a protocol url to the interface and return a new string

References INPROC, IP, IPC, TCP, and UDP.

◆ appendMessage()

int helics::appendMessage ( ActionMessage m,
const ActionMessage newMessage 
)

append a message to multi message container

Parameters
mthe message to add the extra message to
newMessagethe message to append
Returns
the integer location of the message in the stringData section

References helics::ActionMessage::action(), helics::ActionMessage::counter, and helics::ActionMessage::to_string().

Referenced by helics::ForwardingTimeCoordinator::disconnect(), helics::TimeCoordinator::disconnect(), helics::TimeCoordinator::localError(), and helics::CommonCore::setValue().

◆ brokerStateName()

const std::string & helics::brokerStateName ( BrokerBase::BrokerState  state)

◆ changeDetected()

HELICS_CXX_EXPORT bool helics::changeDetected ( const defV prevValue,
const std::string &  val,
double  deltaV 
)

detect a change from the previous values

Referenced by helics::Publication::publish(), and helics::Publication::publishComplex().

◆ cleanupHelicsLibrary()

HELICS_CXX_EXPORT void helics::cleanupHelicsLibrary ( )

function to do some housekeeping work

this runs some cleanup routines and tries to close out any residual thread that haven't been shutdown yet

References helics::BrokerFactory::cleanUpBrokers(), and helics::CoreFactory::cleanUpCores().

◆ commandErrorString()

const char * helics::commandErrorString ( int  errorCode)

return a string associated with a particular error code

Parameters
[in,out]errorCodeThe error to get the string for
Returns
a pointer to string with the name

Referenced by errorMessageString().

◆ coreTypeFromString()

HELICS_CXX_EXPORT CoreType helics::coreTypeFromString ( std::string  type)
noexcept

generate a core type value from a std::string

Parameters
typea string describing the desired core type
Returns
a value of the helics::CoreType enumeration helics::CoreType::unrecognized if the type is not valid

◆ createMessageFromCommand() [1/2]

std::unique_ptr< Message > helics::createMessageFromCommand ( ActionMessage &&  cmd)

create a new message object that moves all the information from the ActionMessage into newly allocated memory for the message

◆ createMessageFromCommand() [2/2]

std::unique_ptr< Message > helics::createMessageFromCommand ( const ActionMessage cmd)

create a new message object that copies all the information from the ActionMessage into newly allocated memory for the message

Referenced by helics::FilterFederate::destinationProcessMessage(), and helics::FilterFederate::processMessageFilter().

◆ doubleExtractAndConvert()

HELICS_CXX_EXPORT double helics::doubleExtractAndConvert ( const data_view dv,
const std::shared_ptr< units::precise_unit > &  inputUnits,
const std::shared_ptr< units::precise_unit > &  outputUnits 
)

convert a dataview to a double and do a unit conversion if appropriate

References helics::ValueConverter< X >::interpret().

◆ errorMessageString()

std::string helics::errorMessageString ( const ActionMessage command)

generate a string representing an error from an ActionMessage

Parameters
commandthe command to generate the error string for
Returns
a string describing the error, if the string is not an error the string is empty

References checkActionFlag(), commandErrorString(), error_flag, and helics::ActionMessage::messageID.

◆ extractInterfaceandPort()

std::pair< std::string, int > helics::extractInterfaceandPort ( const std::string &  address)

extract a port number and interface string from an address number

, if there is no port number it default to -1 this is true if none was listed or the interface doesn't use port numbers

Parameters
addressa string with an network location description i.e 127.0.0.1:34
Returns
a pair with a string and int with the interface name and port number

Referenced by helics::NetworkBrokerData::commandLineParser().

◆ extractInterfaceandPortString()

std::pair< std::string, std::string > helics::extractInterfaceandPortString ( const std::string &  address)

extract a port number string and interface string from an address number

, if there is no port number it default to empty string this is true if none was listed or the interface doesn't use port numbers

Parameters
addressa string with an network location description i.e 127.0.0.1:34
Returns
a pair with 2 strings with the interface name and port number

◆ fedStateString()

const std::string & helics::fedStateString ( FederateStates  state)

convert the state into a human readable string

◆ filterTypeFromString()

HELICS_CXX_EXPORT FilterTypes helics::filterTypeFromString ( const std::string &  filterType)
noexcept

get the filter type from a string

◆ generateFullCoreInitString()

HELICS_CXX_EXPORT std::string helics::generateFullCoreInitString ( const FederateInfo fi)

◆ generateJsonErrorResponse()

std::string helics::generateJsonErrorResponse ( JsonErrorCodes  code,
const std::string &  message 
)
inline

◆ generateMatchingInterfaceAddress()

std::string helics::generateMatchingInterfaceAddress ( const std::string &  server,
InterfaceNetworks  network = InterfaceNetworks::LOCAL 
)

generate an interface that matches a defined server or network specification

References ALL, getLocalExternalAddress(), getLocalExternalAddressV4(), getLocalExternalAddressV6(), IPV4, IPV6, and LOCAL.

Referenced by helics::NetworkCommsInterface::loadNetworkInfo().

◆ getBrokerObject()

BrokerObject * helics::getBrokerObject ( HelicsBroker  broker,
HelicsError err 
)
noexcept

get the brokerObject from a HelicsBroker and verify it is valid

References HELICS_ERROR_INVALID_OBJECT.

Referenced by helicsBrokerClone(), helicsBrokerFree(), and helicsBrokerIsValid().

◆ getCleanedTypeName()

HELICS_CXX_EXPORT std::string_view helics::getCleanedTypeName ( std::string_view  typeName)

convert to a string and also get a cleaned view of the string if it were a specific typeid

returns the input if not changed

References getCleanedTypeName(), and typeNameStringRef().

Referenced by getCleanedTypeName(), and helics::ValueFederateManager::registerInput().

◆ getComplexFromString()

HELICS_CXX_EXPORT std::complex< double > helics::getComplexFromString ( std::string_view  val)

get a complex number from a string

References getComplexFromString(), helicsGetComplex(), and helicsGetVector().

Referenced by getComplexFromString(), and valueExtract().

◆ getCoreObject()

CoreObject * helics::getCoreObject ( HelicsCore  core,
HelicsError err 
)
noexcept

get the CoreObject from a HelicsCore and verify it is valid

References HELICS_ERROR_INVALID_OBJECT.

Referenced by helicsCoreClone(), helicsCoreFree(), and helicsCoreIsValid().

◆ getDoubleFromString()

HELICS_CXX_EXPORT double helics::getDoubleFromString ( std::string_view  val)

get a double from a string

References getDoubleFromString().

Referenced by getDoubleFromString(), getIntFromString(), and valueExtract().

◆ getFedObject()

FedObject * helics::getFedObject ( HelicsFederate  fed,
HelicsError err 
)
noexcept

get the FedObject from a HelicsBroker and verify it is valid

References HELICS_ERROR_INVALID_OBJECT.

Referenced by helicsFederateFree().

◆ getFlagIndex()

HELICS_CXX_EXPORT int helics::getFlagIndex ( std::string  val)

get a flag index from a string name of the flag

Parameters
vala name of a flag option to get an integer index code for use in /ref CoreFederateInfo::setFlagOption
Returns
the integer code for a given flag

Referenced by getPropertyIndex().

◆ getIntFromString()

HELICS_CXX_EXPORT std::int64_t helics::getIntFromString ( std::string_view  val)

get an int from a string

References getDoubleFromString(), and getIntFromString().

Referenced by getIntFromString(), and valueExtract().

◆ getLocalExternalAddress()

std::string helics::getLocalExternalAddress ( const std::string &  server)

get the external ipv4 Ethernet address of the current computer that best matches the listed server

References getLocalExternalAddressV4(), getLocalExternalAddressV6(), and isipv6().

Referenced by generateMatchingInterfaceAddress().

◆ getLocalExternalAddressV4() [1/2]

std::string helics::getLocalExternalAddressV4 ( )

get the external ipv4 address of the current computer

References AsioContextManager::getContextPointer().

Referenced by generateMatchingInterfaceAddress(), getLocalExternalAddress(), and getLocalExternalAddressV4().

◆ getLocalExternalAddressV4() [2/2]

std::string helics::getLocalExternalAddressV4 ( const std::string &  server)

get the external ipv4 Ethernet address of the current computer that best matches the listed server

References AsioContextManager::getContextPointer(), getLocalExternalAddressV4(), and prioritizeExternalAddresses().

◆ getLocalExternalAddressV6() [1/2]

std::string helics::getLocalExternalAddressV6 ( )

get the external ipv4 address of the current computer

References AsioContextManager::getContextPointer().

Referenced by generateMatchingInterfaceAddress(), and getLocalExternalAddress().

◆ getLocalExternalAddressV6() [2/2]

std::string helics::getLocalExternalAddressV6 ( const std::string &  server)

get the external ipv4 Ethernet address of the current computer that best matches the listed server

References AsioContextManager::getContextPointer(), and prioritizeExternalAddresses().

◆ getOptionIndex()

HELICS_CXX_EXPORT int helics::getOptionIndex ( std::string  val)

get an integer option index for a binary flag option

Parameters
vala name of flag option to get an integer index code for used in /ref CoreFederateInfo::setOptionFlag
Returns
the integer code for a given property (-1) if not found

◆ getOptionValue()

HELICS_CXX_EXPORT int helics::getOptionValue ( std::string  val)

get a numerical value for a string option value

Parameters
vala value from an enumeration or flag used as part of a value
Returns
the integer code of a given option value (-1) if not found

◆ getPropertyIndex()

HELICS_CXX_EXPORT int helics::getPropertyIndex ( std::string  val)

get an integer/time property/flag from a string name of the property or flag

Parameters
vala name of property to get an integer index code for used in /ref CoreFederateInfo::setProperty
Returns
the integer code for a given property

References getFlagIndex().

◆ getTypeFromString()

HELICS_CXX_EXPORT DataType helics::getTypeFromString ( std::string_view  typeName)

convert a string to a type

References getTypeFromString().

Referenced by getTypeFromString(), and helics::Publication::Publication().

◆ getValue() [1/2]

template<class X >
X helics::getValue ( ValueFederate fed,
const std::string &  key 
)

get a value directly from the subscription key name

this is a convenience function to get a value directly from the subscription key name this function should not be used as the primary means of retrieving value as it does involve an additional map find operation vs the member getValue calls

Parameters
feda reference to a valueFederate
keythe name of the publication

References helics::ValueFederate::getInput(), and helics::Input::getValue().

◆ getValue() [2/2]

template<class X >
void helics::getValue ( ValueFederate fed,
const std::string &  key,
X &  obj 
)

get a value directly from the subscription key name

this is a convenience function to get a value directly from the subscription key name this function should not be used as the primary means of retrieving value as it does involve an additional map find operation vs the member getValue calls

Parameters
feda reference to a valueFederate
keythe name of the publication
objthe obj to store the retrieved value

References helics::ValueFederate::getSubscription(), and helics::Input::getValue().

◆ gLocalCoreId()

constexpr LocalFederateId helics::gLocalCoreId ( 259)
constexpr

◆ helicsBoolValue()

HELICS_CXX_EXPORT bool helics::helicsBoolValue ( std::string_view  val)

get the boolean value of a string

References helicsBoolValue().

Referenced by helicsBoolValue(), and valueExtract().

◆ helicsComplexString() [1/2]

HELICS_CXX_EXPORT std::string helics::helicsComplexString ( double  real,
double  imag 
)

generate a string representation of a complex number from separate real and imaginary parts

References helicsComplexString().

Referenced by helicsComplexString(), and valueExtract().

◆ helicsComplexString() [2/2]

HELICS_CXX_EXPORT std::string helics::helicsComplexString ( std::complex< double >  val)

generate a string representation of a complex number

References helicsComplexString().

◆ helicsComplexVectorString()

HELICS_CXX_EXPORT std::string helics::helicsComplexVectorString ( const std::vector< std::complex< double >> &  val)

generate a string representation of a complex vector

string will look like cv[1.02+2j,45]

References helicsComplexVectorString().

Referenced by helicsComplexVectorString(), and valueExtract().

◆ helicsDoubleString()

HELICS_CXX_EXPORT std::string helics::helicsDoubleString ( double  val)

generate a string representation of a double

References helicsDoubleString().

Referenced by helicsDoubleString(), and typeConvert().

◆ helicsGetComplex()

HELICS_CXX_EXPORT std::complex< double > helics::helicsGetComplex ( std::string_view  val)

◆ helicsGetComplexVector() [1/2]

HELICS_CXX_EXPORT std::vector< std::complex< double > > helics::helicsGetComplexVector ( std::string_view  val)

convert a string to a complex vector

References helicsGetComplexVector().

Referenced by helicsGetComplexVector(), and valueExtract().

◆ helicsGetComplexVector() [2/2]

HELICS_CXX_EXPORT void helics::helicsGetComplexVector ( std::string_view  val,
std::vector< std::complex< double >> &  data 
)

convert a string to a complex vector using an existing vector

References helicsGetComplex(), helicsGetComplexVector(), and invalidValue().

◆ helicsGetNamedPoint()

HELICS_CXX_EXPORT NamedPoint helics::helicsGetNamedPoint ( std::string_view  val)

convert a string to a named point

References helicsGetNamedPoint(), helics::NamedPoint::name, and helics::NamedPoint::value.

Referenced by helicsGetNamedPoint(), and valueExtract().

◆ helicsGetVector()

HELICS_CXX_EXPORT std::vector< double > helics::helicsGetVector ( std::string_view  val)

convert a string to a vector

References helicsGetVector().

Referenced by getComplexFromString(), helicsGetVector(), and valueExtract().

◆ helicsIntString()

HELICS_CXX_EXPORT std::string helics::helicsIntString ( std::int64_t  val)

generate a string representation of an int

References helicsIntString().

Referenced by helicsIntString().

◆ helicsNamedPointString()

HELICS_CXX_EXPORT std::string helics::helicsNamedPointString ( const NamedPoint point)

generate a named point string

string will look like {"<name>":val}

References helicsNamedPointString(), helics::NamedPoint::name, and helics::NamedPoint::value.

Referenced by helicsNamedPointString(), and valueExtract().

◆ helicsType()

template<class X >
constexpr DataType helics::helicsType ( )
constexpr

template function for generating a known name of a type

◆ helicsVectorString() [1/2]

HELICS_CXX_EXPORT std::string helics::helicsVectorString ( const double *  vals,
size_t  size 
)

generate a string representation of a vector from pointer and size

string will look like v[1.02,45]

References helicsVectorString().

◆ helicsVectorString() [2/2]

HELICS_CXX_EXPORT std::string helics::helicsVectorString ( const std::vector< double > &  val)

generate a string representation of a vector

string will look like v[1.02,45]

References helicsVectorString().

Referenced by helicsVectorString(), and valueExtract().

◆ insertProtocol()

void helics::insertProtocol ( std::string &  networkAddress,
InterfaceTypes  interfaceT 
)

add a protocol url to the interface modifying the string in place

References INPROC, IP, IPC, TCP, and UDP.

Referenced by helics::zeromq::ZmqComms::loadNetworkInfo(), and helics::zeromq::ZmqCommsSS::loadNetworkInfo().

◆ invalidValue()

template<class X >
X helics::invalidValue ( )
inline

generate an invalid value for the various types

Referenced by helicsGetComplexVector().

◆ isBlockSizeValid()

bool helics::isBlockSizeValid ( int  size,
const publication_info pubI 
)
inline

function to check if the size is valid for the given type

References isBlockSizeValid(), and helics::publication_info::size.

Referenced by isBlockSizeValid().

◆ isCoreTypeAvailable()

HELICS_CXX_EXPORT bool helics::isCoreTypeAvailable ( CoreType  type)
noexcept

Returns true if core/broker type specified is available in current compilation.

◆ isDisconnectCommand()

bool helics::isDisconnectCommand ( const ActionMessage command)
inlinenoexcept

check if a command is a disconnect command

◆ isErrorCommand()

bool helics::isErrorCommand ( const ActionMessage command)
inlinenoexcept

check if a command is a disconnect command

◆ isipv6()

bool helics::isipv6 ( const std::string &  address)

check if a specified address is v6 or v4

Returns
true if the address is a v6 address

Referenced by getLocalExternalAddress().

◆ isPriorityCommand()

bool helics::isPriorityCommand ( const ActionMessage command)
inlinenoexcept

check if a command is a priority command

References helics::action_message_def::cmd_ignore.

Referenced by helics::BrokerBase::addActionMessage(), and helics::CommsInterface::transmit().

◆ isProtocolCommand()

bool helics::isProtocolCommand ( const ActionMessage command)
inlinenoexcept

check if a command is a protocol command

Referenced by helics::NetworkCommsInterface::generateReplyToIncomingMessage().

◆ isValidCommand()

bool helics::isValidCommand ( const ActionMessage command)
inlinenoexcept

check if a command is a valid command

References helics::action_message_def::cmd_invalid.

◆ isValidIndex()

template<class sizeType , class SizedDataType >
bool helics::isValidIndex ( sizeType  testSize,
const SizedDataType &  vec 
)
inline

helper template to check whether an index is actually valid for a particular vector

Template Parameters
SizedDataTypea vector like data type that must have a size function
Parameters
testSizean index to test
veca reference to a vector like object that has a size method
Returns
true if it is a valid index false otherwise

Referenced by helics::HandleManager::addHandleAtIndex(), helics::MultiBroker::addRoute(), helics::InputInfo::getData(), helics::HandleManager::getEndpoint(), helics::HandleManager::getFilter(), helics::HandleManager::getHandleInfo(), helics::ValueFederateManager::getInput(), helics::apps::Clone::getMessage(), helics::apps::Recorder::getMessage(), helics::HandleManager::getPublication(), helics::apps::Clone::getValue(), helics::apps::Recorder::getValue(), and helics::apps::Player::runTo().

◆ loadCores()

bool helics::loadCores ( )

load the available core and Broker types into the factory

◆ loadFederateInfo()

HELICS_CXX_EXPORT FederateInfo helics::loadFederateInfo ( const std::string &  configString)

◆ loadTimeFromString() [1/2]

HELICS_CXX_EXPORT Time helics::loadTimeFromString ( const std::string &  timeString)

generate a time from a string

the string can be a double or with units for example "1.234", or "1032ms" or "10423425 ns"

Returns
a helics time generated from the string
Exceptions
invalid_argumentif the string is not a valid time

◆ loadTimeFromString() [2/2]

HELICS_CXX_EXPORT Time helics::loadTimeFromString ( std::string  timeString,
time_units  defUnit 
)

generate a time from a string

the string can be a double or with units for example "1.234" or "1032ms"

Parameters
timeStringthe string containing the time
defUnitthe units to apply to a string with no other units specified
Returns
a helics time generated from the string
Exceptions
invalid_argumentif the string is not a valid time

◆ make_cloning_filter() [1/4]

HELICS_CXX_EXPORT std::unique_ptr< CloningFilter > helics::make_cloning_filter ( FilterTypes  type,
Core cr,
const std::string &  delivery,
const std::string &  name = EMPTY_STRING 
)

create a cloning filter with a delivery location

Parameters
typethe type of filter to create
crthe core to create the filter through
deliverythe endpoint to deliver the cloned message to
namethe name of the filter (optional)
Returns
a unique pointer to a source Filter object, note destroying the object does not deactivate the filter

References addOperations().

◆ make_cloning_filter() [2/4]

HELICS_CXX_EXPORT std::unique_ptr< CloningFilter > helics::make_cloning_filter ( FilterTypes  type,
CoreApp cr,
const std::string &  delivery,
const std::string &  name = EMPTY_STRING 
)

create a cloning filter with a delivery location

Parameters
typethe type of filter to create
crthe core to create the filter through
deliverythe endpoint to deliver the cloned message to
namethe name of the filter (optional)
Returns
a unique pointer to a source Filter object, note destroying the object does not deactivate the filter

References helics::CoreApp::getCopyofCorePointer(), and make_cloning_filter().

◆ make_cloning_filter() [3/4]

HELICS_CXX_EXPORT CloningFilter & helics::make_cloning_filter ( FilterTypes  type,
Federate fed,
const std::string &  delivery,
const std::string &  name = EMPTY_STRING 
)

create a filter

Parameters
typethe type of filter to create
fedthe federate to create the filter through
deliverythe endpoint to deliver the cloned message to
namethe name of the filter (optional)
Returns
a unique pointer to a destination Filter object, note destroying the object does not deactivate the filter

References addOperations(), helics::Federate::getCorePointer(), and helics::Federate::registerCloningFilter().

Referenced by make_cloning_filter(), and helics::FilterFederateManager::registerCloningFilter().

◆ make_cloning_filter() [4/4]

HELICS_CXX_EXPORT CloningFilter & helics::make_cloning_filter ( InterfaceVisibility  locality,
FilterTypes  type,
Federate fed,
const std::string &  delivery,
const std::string &  name = EMPTY_STRING 
)

create a cloning filter with a specified visibility

Parameters
localitycan be global or local
typethe type of filter to create
fedthe federate to create the filter through
deliverythe endpoint to deliver the cloned message to
namethe name of the filter (optional)
Returns
a unique pointer to a destination Filter object, note destroying the object does not deactivate the filter

◆ make_filter() [1/4]

HELICS_CXX_EXPORT std::unique_ptr< Filter > helics::make_filter ( FilterTypes  type,
Core cr,
const std::string &  name = EMPTY_STRING 
)

create a filter

Parameters
typethe type of filter to create
crthe core to create the filter through
namethe name of the filter (optional)
Returns
a unique pointer to a source Filter object, note destroying the object does not deactivate the filter

◆ make_filter() [2/4]

HELICS_CXX_EXPORT std::unique_ptr< Filter > helics::make_filter ( FilterTypes  type,
CoreApp cr,
const std::string &  name = EMPTY_STRING 
)

create a filter

Parameters
typethe type of filter to create
crthe core to create the filter through
namethe name of the filter (optional)
Returns
a unique pointer to a source Filter object, note destroying the object does not deactivate the filter

References helics::CoreApp::getCopyofCorePointer(), and make_filter().

◆ make_filter() [3/4]

HELICS_CXX_EXPORT Filter & helics::make_filter ( FilterTypes  type,
Federate fed,
const std::string &  name = EMPTY_STRING 
)

create a filter

Parameters
typethe type of filter to create
fedthe federate to create the filter through
namethe name of the filter (optional)
Returns
a unique pointer to a destination Filter object, note destroying the object does not deactivate the filter

Referenced by make_filter(), and helics::FilterFederateManager::registerFilter().

◆ make_filter() [4/4]

HELICS_CXX_EXPORT Filter & helics::make_filter ( InterfaceVisibility  locality,
FilterTypes  type,
Federate fed,
const std::string &  name = EMPTY_STRING 
)

create a filter

Parameters
localitythe visibility of the filter global or local
typethe type of filter to create
fedthe federate to create the filter through
namethe name of the filter (optional)
Returns
a unique pointer to a destination Filter object, note destroying the object does not deactivate the filter

◆ make_valid() [1/3]

int64_t helics::make_valid ( bool  obj)
inline

directly convert the boolean to integer

◆ make_valid() [2/3]

int64_t helics::make_valid ( uint64_t  val)
inline

directly convert the boolean to integer

◆ make_valid() [3/3]

template<class X >
decltype(auto) helics::make_valid ( X &&  obj)

this template should do nothing for most classes the specific overloads are the important ones

◆ makePortAddress()

std::string helics::makePortAddress ( const std::string &  networkInterface,
int  portNumber 
)

generate a string with a full address based on an interface string and port number

how things get merged depend on what interface is used some use port number some do not

Parameters
networkInterfacea string with an interface description i.e 127.0.0.1
portNumberthe number of the port to use
Returns
a string with the merged address

Referenced by helics::NetworkBroker< TcpCommsSS, InterfaceTypes::TCP, static_cast< int >(CoreType::TCP_SS)>::generateLocalAddressString(), helics::NetworkCore< TcpCommsSS, InterfaceTypes::TCP >::generateLocalAddressString(), and helics::NetworkCommsInterface::getAddress().

◆ operator!=()

bool helics::operator!= ( const SmallBuffer sb1,
const SmallBuffer sb2 
)
inline

operator to check if small buffers are not equal to each other

◆ operator""_t()

constexpr Time helics::operator""_t ( long double  val)
constexpr

user defined literal for a time variable

◆ operator<<() [1/5]

std::ostream & helics::operator<< ( std::ostream &  os,
const ActionMessage command 
)

stream operator for a command

References prettyPrintString().

◆ operator<<() [2/5]

std::ostream & helics::operator<< ( std::ostream &  os,
GlobalBrokerId  id 
)

stream operator for a federate_id

◆ operator<<() [3/5]

std::ostream & helics::operator<< ( std::ostream &  os,
GlobalFederateId  id 
)

stream operator for a federate_id

◆ operator<<() [4/5]

std::ostream & helics::operator<< ( std::ostream &  os,
GlobalHandle  id 
)

stream operator for a federate_id

◆ operator<<() [5/5]

std::ostream & helics::operator<< ( std::ostream &  os,
route_id  id 
)

stream operator for a route_id

◆ operator==()

bool helics::operator== ( const SmallBuffer sb1,
const SmallBuffer sb2 
)
inline

operator to check if small buffers are equal to each other

◆ prettyPrintString()

std::string helics::prettyPrintString ( const ActionMessage command)

◆ prioritizeExternalAddresses()

std::vector< std::string > helics::prioritizeExternalAddresses ( std::vector< std::string >  high,
std::vector< std::string >  low 
)

create a combined address list with choices in a rough order of priority based on if they appear in both lists, followed by the high priority addresses, and low priority addresses last

Parameters
highaddresses that should be considered before low addresses
lowaddresses that should be considered last
Returns
a vector of strings of ip addresses ordered in roughly the priority they should be used

Referenced by getLocalExternalAddressV4(), and getLocalExternalAddressV6().

◆ publish()

template<class... Us>
void helics::publish ( ValueFederate fed,
const std::string &  pubName,
Us...  pargs 
)

publish directly from the publication name

this is a convenience function to publish directly from the publication name this function should not be used as the primary means of publications as it does involve an additional map find operation vs the member publish calls

Parameters
feda reference to a valueFederate
pubNamethe name of the publication
pargsany combination of arguments that go into the other publish commands

References helics::ValueFederate::getPublication(), and helics::Publication::publish().

◆ queryFederateSubscriptions()

HELICS_CXX_EXPORT std::string helics::queryFederateSubscriptions ( helics::Federate fed,
const std::string &  fedName 
)

helper function to get a list of all the publications a federate subscribes to

Parameters
feda pointer to the federate
fedNamethe name of the federate we are querying
Returns
a string vector of the names of the publication that are subscribed to

References HELICS_SEQUENCING_MODE_ORDERED, and helics::Federate::query().

◆ removeProtocol()

void helics::removeProtocol ( std::string &  networkAddress)

strip any protocol strings from the interface and return a new string

Referenced by helics::NetworkCommsInterface::loadNetworkInfo().

◆ returnableResult()

bool helics::returnableResult ( MessageProcessingResult  result)
inline

function to check if the message processing result should be returned or processing continued

References NEXT_STEP.

◆ setIterationFlags()

void helics::setIterationFlags ( ActionMessage command,
IterationRequest  iterate 
)

◆ state_string()

const std::string & helics::state_string ( operation_state  state)

function to print string for the state

◆ stripProtocol()

std::string helics::stripProtocol ( const std::string &  networkAddress)

strip any protocol strings from the interface and return a new string for example tcp://127.0.0.1 -> 127.0.0.1

Referenced by helics::NetworkCommsInterface::loadNetworkInfo().

◆ timeUnitsFromString()

HELICS_CXX_EXPORT time_units helics::timeUnitsFromString ( const std::string &  unitString)

generate a time related unit,

Returns
a time_units enumeration value
Exceptions
invalid_argumentif the string is not a valid unit

◆ to_string()

HELICS_CXX_EXPORT std::string helics::to_string ( CoreType  type)

generate a string based on the core type

◆ typeConvert()

HELICS_CXX_EXPORT SmallBuffer helics::typeConvert ( DataType  type,
double  val 
)

convert a value to a data block to be interpreted using the specified type

Parameters
typethe type used for the data conversion
vala double to convert

References helicsDoubleString(), typeConvert(), and typeNameStringRef().

Referenced by helics::Publication::publish(), helics::Publication::publishComplex(), and typeConvert().

◆ typeNameString()

template<class X >
constexpr const char* helics::typeNameString ( )
inlineconstexpr

template class for generating a known name of a type

◆ typeNameString< bool >()

template<>
constexpr const char* helics::typeNameString< bool > ( )
inlineconstexpr

for boolean

◆ typeNameString< char >()

template<>
constexpr const char* helics::typeNameString< char > ( )
inlineconstexpr

for character

◆ typeNameString< double >()

template<>
constexpr const char* helics::typeNameString< double > ( )
inlineconstexpr

for float

◆ typeNameString< float >()

template<>
constexpr const char* helics::typeNameString< float > ( )
inlineconstexpr

for float

◆ typeNameString< int64_t >()

template<>
constexpr const char* helics::typeNameString< int64_t > ( )
inlineconstexpr

for 64 bit unsigned integer

◆ typeNameString< std::complex< double > >()

template<>
constexpr const char* helics::typeNameString< std::complex< double > > ( )
inlineconstexpr

for complex double

◆ typeNameString< std::complex< float > >()

template<>
constexpr const char* helics::typeNameString< std::complex< float > > ( )
inlineconstexpr

for complex double

◆ typeNameString< std::int32_t >()

template<>
constexpr const char* helics::typeNameString< std::int32_t > ( )
inlineconstexpr

for integer

◆ typeNameString< std::uint32_t >()

template<>
constexpr const char* helics::typeNameString< std::uint32_t > ( )
inlineconstexpr

for unsigned integer

◆ typeNameString< std::uint64_t >()

template<>
constexpr const char* helics::typeNameString< std::uint64_t > ( )
inlineconstexpr

for 64 bit unsigned integer

◆ typeNameString< unsigned char >()

template<>
constexpr const char* helics::typeNameString< unsigned char > ( )
inlineconstexpr

for unsigned character

◆ typeNameStringRef()

const HELICS_CXX_EXPORT std::string & helics::typeNameStringRef ( DataType  type)

◆ valueExtract() [1/10]

template<class X >
std::enable_if_t<std::is_arithmetic<X>::value && (!std::is_same<X, char>::value)> helics::valueExtract ( const data_view dv,
DataType  baseType,
X &  val 
)

assume it is some numeric type (int or double)

◆ valueExtract() [2/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
bool &  val 
)

extract the value from a variant to a bool

References helicsBoolValue(), and vectorNorm().

◆ valueExtract() [3/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
char &  val 
)

extract the value from a variant to a character

References getDoubleFromString(), and invalidDouble.

◆ valueExtract() [4/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
NamedPoint val 
)

◆ valueExtract() [5/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
std::complex< double > &  val 
)

extract the value from a variant to a complex number

References getComplexFromString().

◆ valueExtract() [6/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
std::string &  val 
)

extract the value from a variant to a string

References helicsComplexString(), helicsComplexVectorString(), helicsNamedPointString(), and helicsVectorString().

◆ valueExtract() [7/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
std::vector< double > &  val 
)

extract the value from a variant to a vector of doubles

References helicsGetVector().

◆ valueExtract() [8/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
std::vector< std::complex< double >> &  val 
)

extract the value from a variant to a complex vector of doubles

References helicsGetComplexVector().

◆ valueExtract() [9/10]

HELICS_CXX_EXPORT void helics::valueExtract ( const defV dv,
Time val 
)

extract the value from a variant to a named point

References getDoubleFromString(), getIntFromString(), and timeZero.

◆ valueExtract() [10/10]

template<class X >
std::enable_if_t<std::is_arithmetic<X>::value && (!std::is_same<X, char>::value)> helics::valueExtract ( const defV dv,
X &  val 
)

extract the value from a variant to a numerical type

References getDoubleFromString(), getIntFromString(), and vectorNorm().

◆ vectorizeAndSortQueryResult() [1/2]

HELICS_CXX_EXPORT std::vector< std::string > helics::vectorizeAndSortQueryResult ( const std::string &  queryres)

function takes a query result, vectorizes and sorts it if the query is a vector result, if not the results go into the first element of the vector

References vectorizeQueryResult().

◆ vectorizeAndSortQueryResult() [2/2]

HELICS_CXX_EXPORT std::vector< std::string > helics::vectorizeAndSortQueryResult ( std::string &&  queryres)

function takes a query result, vectorizes and sorts it if the query is a vector result, if not the results go into the first element of the vector

References vectorizeQueryResult().

◆ vectorizeIndexQuery()

HELICS_CXX_EXPORT std::vector< int > helics::vectorizeIndexQuery ( const std::string &  queryres)

function takes a query result and vectorizes it if the query is a vector result of integer indices, if not the results are an empty vector

◆ vectorizeQueryResult() [1/2]

HELICS_CXX_EXPORT std::vector< std::string > helics::vectorizeQueryResult ( const std::string &  queryres)

function takes a query result and vectorizes it if the query is a vector result, if not the results go into the first element of the vector

◆ vectorizeQueryResult() [2/2]

HELICS_CXX_EXPORT std::vector< std::string > helics::vectorizeQueryResult ( std::string &&  queryres)

function takes a query result and vectorizes it if the query is a vector result, if not the results go into the first element of the vector

Referenced by vectorizeAndSortQueryResult().

◆ vectorNorm() [1/2]

HELICS_CXX_EXPORT double helics::vectorNorm ( const std::vector< double > &  vec)

compute the L2 norm of a vector

References vectorNorm().

Referenced by valueExtract(), and vectorNorm().

◆ vectorNorm() [2/2]

HELICS_CXX_EXPORT double helics::vectorNorm ( const std::vector< std::complex< double >> &  vec)

compute the L2 norm of a magnitudes of a complex vector

References vectorNorm().

◆ waitForFed()

HELICS_CXX_EXPORT bool helics::waitForFed ( helics::Federate fed,
const std::string &  fedName,
std::chrono::milliseconds  timeout = std::chrono::milliseconds(10000) 
)

helper function to wait for a particular federate to be created

this is useful if some reason we need to make sure a federate is created before proceeding

Parameters
feda pointer to the federate
fedNamethe name of the federate we are querying
timeoutthe amount of time in ms to wait before returning false
Returns
true if the federate exists, false if the timeout occurred

References helics::Federate::query().

◆ waitForInit()

HELICS_CXX_EXPORT bool helics::waitForInit ( helics::Federate fed,
const std::string &  fedName,
std::chrono::milliseconds  timeout = std::chrono::milliseconds(10000) 
)

helper function to wait for a particular federate has requested initialization mode

this is useful for querying information and being reasonably certain the federate is done adding to its interface

Parameters
feda pointer to the federate
fedNamethe name of the federate we are querying
timeoutthe time to wait for the fed to initialize
Returns
true if the federate is now trying to enter initialization false if the timeout was reached

References HELICS_SEQUENCING_MODE_ORDERED, and helics::Federate::query().

Variable Documentation

◆ buildFlags

constexpr auto helics::buildFlags = HELICS_BUILD_FLAGS_DEBUG
constexpr

build flags used to compile helics

Referenced by helicsGetBuildFlags().

◆ compiler

constexpr auto helics::compiler = HELICS_COMPILER_VERSION
constexpr

compiler used to build helics

Referenced by helicsGetCompilerVersion().

◆ defBrokerInterface

constexpr const char* helics::defBrokerInterface[]
constexpr
Initial value:
= {"127.0.0.1",
"127.0.0.1",
"tcp://127.0.0.1",
"_ipc_broker",
""}

◆ defInterface

constexpr const char* helics::defInterface[]
constexpr
Initial value:
= {"127.0.0.1",
"127.0.0.1",
"tcp://127.0.0.1",
"_ipc_broker",
""}

◆ direct_core_id

constexpr GlobalFederateId helics::direct_core_id {-235262}
constexpr

identifier to target the local core even if the global id hasn't been assigned yet

Referenced by helics::CommonCore::setGlobal().

◆ gDirectSendHandle

constexpr InterfaceHandle helics::gDirectSendHandle
constexpr
Initial value:
{
-1'745'234}

this special handle can be used to directly send a message in a core

Referenced by helics::CommonCore::sendMessage().

◆ gGlobalBrokerIdShift

constexpr IdentifierBaseType helics::gGlobalBrokerIdShift {0x7000'0000}
constexpr

a shift in the global id index to discriminate between global ids of brokers vs federates

◆ gGlobalFederateIdShift

constexpr IdentifierBaseType helics::gGlobalFederateIdShift {0x0002'0000}
constexpr

a shift in the global federate id numbers to allow discrimination between local ids and global ones this value allows 131072 federates to be available in each core 1,878,917,120 allowable federates in the system and 268,435,455 brokers allowed if we need more than that this, HELICS as a program has been phenomenally successful beyond all wildest imaginations and we can probably afford to change these to 64 bit numbers to accommodate. Of the available federates there is 1 federate number that can be defined per core for various purposes. These are the upper number of federate id's so 268,435,455 reserved federate id's. An ID of 1 is reserved for the root broker

◆ initializationTime

constexpr Time helics::initializationTime = negEpsilon
constexpr

◆ invalid_id_value

constexpr IdentifierType helics::invalid_id_value
constexpr
Initial value:
=
static_cast<IdentifierType>(-1)

defining an invalid id value

◆ negEpsilon

constexpr Time helics::negEpsilon = -Time::epsilon()
constexpr

definition of the smallest negative increment of time

◆ parent_broker_id

constexpr GlobalBrokerId helics::parent_broker_id {0}
constexpr

◆ root_broker_id

constexpr GlobalBrokerId helics::root_broker_id {1}
constexpr

constant to use for indicating the id of the root broker

Referenced by helics::CommonCore::setGlobal().

◆ timeEpsilon

constexpr Time helics::timeEpsilon = Time::epsilon()
constexpr

definition of the minimum time resolution

Referenced by helics::apps::Source::runTo().

◆ timeZero

constexpr Time helics::timeZero = Time::zeroVal()
constexpr

◆ tstr

constexpr const char* helics::tstr[]
constexpr
Initial value:
= {"default",
"ZeroMQ",
"MPI",
"TEST",
"IPC",
"interprocess",
"TCP",
"UDP",
"undef",
"nng",
"ZMQ_SS",
"TCPSS",
"undef",
"undef",
"http",
"unknown"}

◆ versionBuild

constexpr auto helics::versionBuild = HELICS_VERSION_BUILD
constexpr

the build string if any

◆ versionMajor

constexpr int helics::versionMajor = HELICS_VERSION_MAJOR
constexpr

get the Major version number

◆ versionMinor

constexpr int helics::versionMinor = HELICS_VERSION_MINOR
constexpr

get the Minor version number

◆ versionPatch

constexpr int helics::versionPatch = HELICS_VERSION_PATCH
constexpr

get the patch number

◆ versionString

constexpr auto helics::versionString = HELICS_VERSION_STRING
constexpr

a string representation of the HELICS version

Referenced by helicsGetVersion().

helics::IdentifierType
std::uint32_t IdentifierType
specify the underlying type used in the identifiers
Definition: helicsTypes.hpp:22