![]() |
helics
2.8.1
|
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 | |
BrokerFactory | |
CoreFactory | |
Typedefs | |
using | defV = mpark::variant< double, int64_t, std::string, std::complex< double >, std::vector< double >, std::vector< std::complex< double > >, NamedPoint > |
using | identifier_type = std::uint32_t |
specify the underlying type used in the identifiers | |
using | publication_id_t = identifier_id_t< identifier_type, identifiers::publication, invalid_id_value > |
using | input_id_t = identifier_id_t< identifier_type, identifiers::input, invalid_id_value > |
using | query_id_t = identifier_id_t< identifier_type, 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 > >() !=data_type::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 = mpark::variant< double, std::string > |
using | portData = std::vector< std::tuple< int, bool, std::shared_ptr< Broker > >> |
using | stringVector = gmlc::utilities::stringVector |
using | actionPair = std::pair< action_message_def::action_t, const char * > |
using | errorPair = std::pair< int, const char * > |
using | activeProtector = gmlc::libguarded::guarded< std::pair< bool, bool > > |
using | identififier_base_type = int32_t |
using | Time = TimeRepresentation< count_time< 9 > > |
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 | filter_types { 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 | type_location { double_loc = 0, int_loc = 1, string_loc = 2, complex_loc = 3, vector_loc = 4, complex_vector_loc = 5, named_point_loc = 6 } |
enum | identifiers : char { publication, input, filter, endpoint, query } |
enum | interface_visibility { local, global } |
enum | data_type : int { 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_multi = helics_data_type_multi, helics_json = helics_data_type_json, helics_unknown = 262355 } |
enum | multi_input_handling_method : 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 | cmd_error_codes : 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, multiple_wait_for_current_time_flags = 15 } |
enum | handle_type : char { unknown = 'u', handle_type::publication = 'p', handle_type::input = 'i', handle_type::endpoint = 'e', handle_type::filter = 'f' } |
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 | subqueries : std::uint16_t { general_query = 0, current_time_map = 2, dependency_graph = 3, data_flow_graph = 4, global_state = 6, global_time_debugging = 7, global_flush = 8, global_status = 9, 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 | operation_state : std::uint8_t { operating = 0, error = 5, disconnected = 10 } |
enum | federate_state { HELICS_CREATED, HELICS_INITIALIZING, HELICS_EXECUTING, HELICS_TERMINATING, HELICS_ERROR, HELICS_FINISHED, HELICS_UNKNOWN } |
enum | core_type : int { core_type::DEFAULT = helics_core_type_default, core_type::ZMQ = helics_core_type_zmq, core_type::MPI = helics_core_type_mpi, core_type::TEST = helics_core_type_test, core_type::INTERPROCESS = helics_core_type_interprocess, core_type::IPC = helics_core_type_ipc, core_type::TCP = helics_core_type_tcp, core_type::TCP_SS = helics_core_type_tcp_ss, core_type::UDP = helics_core_type_udp, core_type::NNG = helics_core_type_nng, core_type::ZMQ_SS = helics_core_type_zmq_test, core_type::HTTP = helics_core_type_http, core_type::WEBSOCKET = helics_core_type_websocket, core_type::INPROC = helics_core_type_inproc, core_type::NULLCORE = helics_core_type_null, core_type::UNRECOGNIZED = 22, core_type::MULTI = 45 } |
enum | message_processing_result : signed char { message_processing_result::continue_processing = -2, message_processing_result::delay_message = -1, message_processing_result::next_step = 0, message_processing_result::error = 1, message_processing_result::halted = 2, message_processing_result::iterating = 3, reprocess_message = 8 } |
enum | iteration_result : signed char { iteration_result::next_step = 0, iteration_result::error = 1, iteration_result::halted = 2, iteration_result::iterating = 3 } |
enum | iteration_request : signed char { iteration_request::no_iterations = 0, iteration_request::force_iteration = 1, iteration_request::iterate_if_needed = 2 } |
enum | subqueries : std::uint16_t { general_query = 0, current_time_map = 2, dependency_graph = 3, data_flow_graph = 4, global_state = 6, global_time_debugging = 7, global_flush = 8, global_status = 9, 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 | connection_state : std::uint8_t { connected = 0, init_requested = 1, operating = 2, error = 40, request_disconnect = 48, disconnected = 50 } |
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 | interface_networks : char { interface_networks::local = 0, interface_networks::ipv4 = 4, interface_networks::ipv6 = 6, interface_networks::all = 10 } |
enum | interface_type : char { interface_type::tcp = 0, interface_type::udp = 1, interface_type::ip = 2, interface_type::ipc = 3, interface_type::inproc = 4 } |
enum | vtype : int { generic_fed, value_fed, message_fed, combination_fed, invalid_fed } |
Functions | |
template<> | |
const char * | typeNameString< std::vector< data_block > > () |
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) |
filter_types | filterTypeFromString (const std::string &filterType) noexcept |
void | addOperations (Filter *filt, filter_types type, Core *) |
Filter & | make_filter (filter_types type, Federate *mFed, const std::string &name) |
Filter & | make_filter (interface_visibility locality, filter_types type, Federate *mFed, const std::string &name) |
std::unique_ptr< Filter > | make_filter (filter_types type, Core *cr, const std::string &name) |
std::unique_ptr< Filter > | make_filter (filter_types type, CoreApp &cr, const std::string &name) |
CloningFilter & | make_cloning_filter (filter_types type, Federate *mFed, const std::string &delivery, const std::string &name) |
CloningFilter & | make_cloning_filter (interface_visibility locality, filter_types type, Federate *mFed, const std::string &delivery, const std::string &name) |
std::unique_ptr< CloningFilter > | make_cloning_filter (filter_types type, Core *cr, const std::string &delivery, const std::string &name) |
std::unique_ptr< CloningFilter > | make_cloning_filter (filter_types 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, const char *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, data_type baseType, std::string &val) |
void | valueExtract (const data_view &dv, data_type baseType, std::vector< double > &val) |
void | valueExtract (const data_view &dv, data_type baseType, std::vector< std::complex< double >> &val) |
void | valueExtract (const data_view &dv, data_type baseType, std::complex< double > &val) |
void | valueExtract (const data_view &dv, data_type baseType, NamedPoint &val) |
void | valueExtract (const data_view &dv, data_type baseType, Time &val) |
void | valueExtract (const data_view &dv, data_type baseType, bool &val) |
void | valueExtract (const data_view &dv, data_type baseType, defV &val) |
void | valueExtract3 (const data_view &dv, data_type baseType, defV &val) |
void | valueConvert (defV &val, data_type 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 > | valueExtract (const data_view &dv, data_type baseType, X &val) |
const std::string & | typeNameStringRef (data_type type) |
double | vectorNorm (const std::vector< double > &vec) |
double | vectorNorm (const std::vector< std::complex< double >> &vec) |
std::string | helicsComplexString (double real, double imag) |
std::string | helicsComplexString (std::complex< double > val) |
data_type | getTypeFromString (const std::string &typeName) |
const std::regex | creg (R"(([+-]?(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?)\s*([+-]\s*(\d+(\.\d+)?|\.\d+)([eE][+-]?\d+)?)[ji]*)") |
std::complex< double > | helicsGetComplex (const std::string &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 (const std::string &pointName, double val) |
std::string | helicsNamedPointString (const char *pointName, double val) |
std::vector< double > | helicsGetVector (const std::string &val) |
std::vector< std::complex< double > > | helicsGetComplexVector (const std::string &val) |
NamedPoint | helicsGetNamedPoint (const std::string &val) |
std::complex< double > | getComplexFromString (const std::string &val) |
double | getDoubleFromString (const std::string &val) |
void | helicsGetVector (const std::string &val, std::vector< double > &data) |
void | helicsGetComplexVector (const std::string &val, std::vector< std::complex< double >> &data) |
bool | helicsBoolValue (const std::string &val) |
data_block | emptyBlock (data_type outputType, data_type inputType=data_type::helics_any) |
data_block | typeConvert (data_type type, double val) |
data_block | typeConvert (data_type type, int64_t val) |
data_block | typeConvert (data_type type, const char *val) |
data_block | typeConvert (data_type type, const std::string &val) |
data_block | typeConvert (data_type type, const std::vector< double > &val) |
data_block | typeConvert (data_type type, const double *vals, size_t size) |
data_block | typeConvert (data_type type, const std::vector< std::complex< double >> &val) |
data_block | typeConvert (data_type type, const std::complex< double > &val) |
data_block | typeConvert (data_type type, const NamedPoint &val) |
data_block | typeConvert (data_type type, const char *str, double val) |
data_block | typeConvert (data_type type, bool val) |
data_block | typeConvert (data_type type, const std::string &str, double 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 | isRawType (data_type type) |
template<class X > | |
constexpr data_type | helicsType () |
template<> | |
constexpr data_type | helicsType< int64_t > () |
template<> | |
constexpr data_type | helicsType< bool > () |
template<> | |
constexpr data_type | helicsType< std::string > () |
template<> | |
constexpr data_type | helicsType< NamedPoint > () |
template<> | |
constexpr data_type | helicsType< double > () |
template<> | |
constexpr data_type | helicsType< Time > () |
template<> | |
constexpr data_type | helicsType< std::complex< double > > () |
template<> | |
constexpr data_type | helicsType< std::vector< double > > () |
template<> | |
constexpr data_type | 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 > | |
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 > | |
X | varMax (const std::vector< defV > &vals) |
template<class X , class Y , typename OP > | |
Y | 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 > | |
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) |
double | doubleExtractAndConvert3 (const data_view &dv, const std::shared_ptr< units::precise_unit > &inputUnits, const std::shared_ptr< units::precise_unit > &outputUnits) |
void | integerExtractAndConvert3 (defV &store, const data_view &dv, const std::shared_ptr< units::precise_unit > &inputUnits, const std::shared_ptr< units::precise_unit > &outputUnits) |
template<class X > | |
const X & | getValueRefImpl (defV &val) |
template<> | |
const std::string & | getValueRefImpl (defV &val) |
data_block | typeConvert (data_type type, const defV &val) |
template<class X > | |
std::enable_if_t< helicsType< X >) !=data_type::helics_custom, std::unique_ptr< Publication > > | make_publication (ValueFederate *valueFed, const std::string &key, const std::string &units=std::string()) |
template<class X , class FedPtr > | |
std::enable_if_t< helicsType< X >) !=data_type::helics_custom, std::unique_ptr< Publication > > | make_publication (FedPtr &valueFed, const std::string &key, const std::string &units=std::string()) |
template<class X > | |
std::enable_if_t< helicsType< X >) !=data_type::helics_custom, std::unique_ptr< Publication > > | make_publication (interface_visibility locality, ValueFederate *valueFed, const std::string &key, const std::string &units=std::string()) |
template<class X , class FedPtr > | |
std::enable_if_t< helicsType< X >) !=data_type::helics_custom, std::unique_ptr< Publication > > | make_publication (interface_visibility locality, FedPtr &valueFed, const std::string &key, const std::string &units=std::string()) |
template<class... Us> | |
void | publish (ValueFederate &fed, const std::string &pubKey, Us... pargs) |
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) |
Input & | make_subscription (ValueFederate *valueFed, const std::string &key, const std::string &units=std::string()) |
Input & | make_subscription (ValueFederate &valueFed, const std::string &key, const std::string &units=std::string()) |
template<class X > | |
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 (core_type type) |
core_type | coreTypeFromString (std::string type) noexcept |
bool | isCoreTypeAvailable (core_type type) noexcept |
template<class Archive > | |
void | save (Archive &ar, const data_block &db) |
template<class Archive > | |
void | load (Archive &ar, data_block &db) |
template<class Archive > | |
void | save (Archive &ar, const data_view &db) |
template<class Archive > | |
void | load (Archive &ar, data_view &db) |
template<class Archive > | |
void | serialize (Archive &archive, NamedPoint &m) |
template<class X > | |
constexpr std::enable_if_t<!is_iterable< X >::value &&!std::is_convertible< X, std::string >::value, size_t > | getMinSize () |
template<class X > | |
constexpr std::enable_if_t< is_iterable< X >::value &&!std::is_convertible< X, std::string >::value, size_t > | getMinSize () |
template<class X > | |
constexpr std::enable_if_t< std::is_convertible< X, std::string >::value, size_t > | getMinSize () |
template<> | |
constexpr size_t | getMinSize< NamedPoint > () |
int | getTypeSize (const std::string &type) |
bool | isBlockSizeValid (int size, const publication_info &pubI) |
bool | allowMultiBroker () |
void | processOptions (const toml::value §ion, 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 §ion, const std::function< int(const std::string &)> &optionConversion, const std::function< int(const std::string &)> &valueConversion, const std::function< void(int, int)> &optionAction) |
template<typename Callable > | |
void | addTargets (const toml::value §ion, std::string targetName, Callable callback) |
template<typename Callable > | |
void | addTargets (const Json::Value §ion, std::string targetName, Callable callback) |
template<std::size_t DataSize> | |
void | swap_bytes (std::uint8_t *data) |
std::unique_ptr< Message > | createMessageFromCommand (const ActionMessage &cmd) |
std::unique_ptr< Message > | createMessageFromCommand (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, iteration_request 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::broker_state_t state) |
const std::string & | state_string (operation_state state) |
bool | operator!= (const data_block &db1, const data_block &db2) |
template<class sizeType , class SizedDataType > | |
bool | isValidIndex (sizeType testSize, const SizedDataType &vec) |
const std::string & | fedStateString (federate_state state) |
bool | returnableResult (message_processing_result result) |
const std::string & | state_string (connection_state state) |
std::ostream & | operator<< (std::ostream &os, local_federate_id fid) |
std::ostream & | operator<< (std::ostream &os, interface_handle handle) |
std::ostream & | operator<< (std::ostream &os, global_broker_id id) |
std::ostream & | operator<< (std::ostream &os, global_federate_id id) |
std::ostream & | operator<< (std::ostream &os, global_handle id) |
std::ostream & | operator<< (std::ostream &os, route_id id) |
constexpr local_federate_id | local_core_id (-259) |
template<class brkX > | |
void | makeConnectionsToml (brkX *brk, const std::string &file) |
template<class brkX > | |
void | makeConnectionsJson (brkX *brk, const std::string &file) |
constexpr route_id | generateRouteId (int32_t route_type_code, int32_t index) |
constexpr int32_t | getRouteTypeCode (route_id rid) |
constexpr Time | operator""_t (long double val) |
HelicsConfigJSON * | addJsonConfig (CLI::App *app) |
Add the HELICS JSON configuration processor to the app. | |
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::tuple< federate_state, message_processing_result, bool > | processCoordinatorMessage (ActionMessage &cmd, TimeCoordinator *timeCoord, const federate_state state, const bool timeGranted_mode, const global_federate_id 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, global_federate_id self, global_federate_id ignore) |
TimeData | generateMinTimeDownstream (const TimeDependencies &dependencies, bool restricted, global_federate_id self, global_federate_id ignore) |
TimeData | generateMinTimeTotal (const TimeDependencies &dependencies, bool restricted, global_federate_id self, global_federate_id 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, interface_type interfaceT) |
void | insertProtocol (std::string &networkAddress, interface_type 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, interface_networks network) |
FedObject * | getFedObject (helics_federate fed, helics_error *err) noexcept |
CoreObject * | getCoreObject (helics_core core, helics_error *err) noexcept |
BrokerObject * | getBrokerObject (helics_broker broker, helics_error *err) noexcept |
Variables | |
constexpr auto | bvecstr = "block_vector" |
const std::string | emptyStr |
constexpr identifier_type | invalid_id_value |
defining an invalid id value More... | |
constexpr interface_visibility | GLOBAL = interface_visibility::global |
constexpr interface_visibility | LOCAL = interface_visibility::local |
constexpr double | invalidDouble = -1e48 |
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 [] = "**" |
constexpr interface_handle | direct_send_handle {-1'745'234} |
this special handle can be used to directly send a message in a core | |
const std::vector< interface_handle > | emptyHandles |
constexpr Time | startupTime = Time::minVal() |
constexpr Time | initialTime {-1000000.0} |
constexpr identififier_base_type | global_federate_id_shift {0x0002'0000} |
constexpr identififier_base_type | global_broker_id_shift {0x7000'0000} |
constexpr global_broker_id | parent_broker_id {0} |
constexpr global_broker_id | root_broker_id {1} |
constexpr global_federate_id | 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 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 | |
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
@ file @detail different signal generators for the source app
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
using helics::defV = typedef mpark::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
using helics::identififier_base_type = typedef int32_t |
base date type for id types
using helics::Time = typedef TimeRepresentation<count_time<9> > |
Simulation virtual time.
Class represents time in the core.
using helics::typeCategory = typedef std::conditional_t<helicsType<remove_cv_ref<X> >() != data_type::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
|
strong |
enumeration of possible states of a remote federate or broker
|
strong |
the type of the cores that are available
|
strong |
the base data types for helics
enumeration of the possible federate states
|
strong |
a set of common defined filters
define extra flag definitions
|
strong |
|
strong |
the known types of identifiers
|
strong |
|
strong |
|
strong |
enumeration of locality namespaces
|
strong |
|
strong |
enumeration of the possible states of iteration
|
strong |
|
strong |
enumeration of the possible message processing results
|
strong |
enumeration of possible operating conditions for a federate
|
strong |
enumeration of possible random number generator distributions
|
strong |
enumeration of possible states for a federate to be in regards to time request
enumeration of the order inside the variant so the Which function returns match the enumeration
|
strong |
type code embedded in the objects so the library knows how to cast them appropriately
const char * helics::actionMessageType | ( | action_message_def::action_t | action | ) |
return the name of the action
action | The action to get the name for |
Referenced by prettyPrintString().
void helics::addOperations | ( | Filter * | filt, |
filter_types | type, | ||
Core * | |||
) |
add a defined operation to a filter
Referenced by make_cloning_filter().
std::string helics::addProtocol | ( | const std::string & | networkAddress, |
interface_type | interfaceT | ||
) |
int helics::appendMessage | ( | ActionMessage & | m, |
const ActionMessage & | newMessage | ||
) |
append a message to multi message container
m | the message to add the extra message to |
newMessage | the message to append |
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().
const std::string & helics::brokerStateName | ( | BrokerBase::broker_state_t | state | ) |
helper function to generate the name of a state as a string
References helics::BrokerBase::configured, helics::BrokerBase::configuring, helics::BrokerBase::connected, helics::BrokerBase::connecting, helics::BrokerBase::created, helics::BrokerBase::errored, helics::BrokerBase::initializing, helics::BrokerBase::operating, helics::BrokerBase::terminated, and helics::BrokerBase::terminating.
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().
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().
const char * helics::commandErrorString | ( | int | errorCode | ) |
return a string associated with a particular error code
[in,out] | errorCode | The error to get the string for |
Referenced by errorMessageString().
|
noexcept |
generate a core type value from a std::string
type | a string describing the desired core type |
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
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().
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().
HELICS_CXX_EXPORT double helics::doubleExtractAndConvert3 | ( | 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::ValueConverter3< X >::interpret().
std::string helics::errorMessageString | ( | const ActionMessage & | command | ) |
generate a string representing an error from an ActionMessage
command | the command to generate the error string for |
References checkActionFlag(), commandErrorString(), error_flag, and helics::ActionMessage::messageID.
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
address | a string with an network location description i.e 127.0.0.1:34 |
Referenced by helics::NetworkBrokerData::commandLineParser().
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
address | a string with an network location description i.e 127.0.0.1:34 |
const std::string & helics::fedStateString | ( | federate_state | state | ) |
convert the state into a human readable string
|
noexcept |
get the filter type from a string
HELICS_CXX_EXPORT std::string helics::generateFullCoreInitString | ( | const FederateInfo & | fi | ) |
generate string for passing arguments to the core
References helics::FederateInfo::autobroker, helics::FederateInfo::broker, helics::FederateInfo::brokerInitString, helics::FederateInfo::brokerPort, helics::FederateInfo::coreInitString, helics::FederateInfo::debugging, helics::FederateInfo::fileInUse, helics::FederateInfo::key, helics::FederateInfo::localport, helics::FederateInfo::profilerFileName, and helics::FederateInfo::useJsonSerialization.
Referenced by helics::Federate::Federate().
std::string helics::generateMatchingInterfaceAddress | ( | const std::string & | server, |
interface_networks | network = interface_networks::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().
|
noexcept |
get the brokerObject from a helics_broker and verify it is valid
References helics_error_invalid_object.
Referenced by helicsBrokerClone(), helicsBrokerFree(), and helicsBrokerIsValid().
HELICS_CXX_EXPORT std::complex< double > helics::getComplexFromString | ( | const std::string & | val | ) |
get a complex number from a string
References getComplexFromString(), helicsGetComplex(), and helicsGetVector().
Referenced by getComplexFromString(), and valueExtract().
|
noexcept |
get the CoreObject from a helics_core and verify it is valid
References helics_error_invalid_object.
Referenced by helicsCoreClone(), helicsCoreFree(), and helicsCoreIsValid().
HELICS_CXX_EXPORT double helics::getDoubleFromString | ( | const std::string & | val | ) |
get a double from a string
References getDoubleFromString().
Referenced by getDoubleFromString(), helicsGetNamedPoint(), and valueExtract().
|
noexcept |
get the FedObject from a helics_broker and verify it is valid
References fed, and helics_error_invalid_object.
Referenced by helicsFederateFree().
HELICS_CXX_EXPORT int helics::getFlagIndex | ( | std::string | val | ) |
get a flag index from a string name of the flag
val | a name of a flag option to get an integer index code for use in /ref CoreFederateInfo::setFlagOption |
Referenced by getPropertyIndex().
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().
std::string helics::getLocalExternalAddressV4 | ( | ) |
get the external ipv4 address of the current computer
References AsioContextManager::getContextPointer().
Referenced by generateMatchingInterfaceAddress(), getLocalExternalAddress(), and getLocalExternalAddressV4().
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().
std::string helics::getLocalExternalAddressV6 | ( | ) |
get the external ipv4 address of the current computer
References AsioContextManager::getContextPointer().
Referenced by generateMatchingInterfaceAddress(), and getLocalExternalAddress().
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().
|
constexpr |
for non iterable classes and not strings
|
constexpr |
for class that are iterable and not strings like vector
|
constexpr |
min size for a named point
HELICS_CXX_EXPORT int helics::getOptionIndex | ( | std::string | val | ) |
get an integer option index for a binary flag option
val | a name of flag option to get an integer index code for used in /ref CoreFederateInfo::setOptionFlag |
HELICS_CXX_EXPORT int helics::getOptionValue | ( | std::string | val | ) |
get a numerical value for a string option value
val | a value from an enumeration or flag used as part of a value |
HELICS_CXX_EXPORT int helics::getPropertyIndex | ( | std::string | val | ) |
get an integer/time property/flag from a string name of the property or flag
val | a name of property to get an integer index code for used in /ref CoreFederateInfo::setProperty |
References getFlagIndex().
HELICS_CXX_EXPORT data_type helics::getTypeFromString | ( | const std::string & | typeName | ) |
convert a string to a type
References getTypeFromString().
Referenced by getTypeFromString(), and helics::Publication::Publication().
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
fed | a reference to a valueFederate |
key | the name of the publication |
References fed.
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
fed | a reference to a valueFederate |
key | the name of the publication |
obj | the obj to store the retrieved value |
References fed.
HELICS_CXX_EXPORT bool helics::helicsBoolValue | ( | const std::string & | val | ) |
get the boolean value of a string
References helicsBoolValue().
Referenced by helicsBoolValue(), and valueExtract().
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(), helicsComplexVectorString(), and valueExtract().
HELICS_CXX_EXPORT std::string helics::helicsComplexString | ( | std::complex< double > | val | ) |
generate a string representation of a complex number
References helicsComplexString().
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 helicsComplexString(), and helicsComplexVectorString().
Referenced by helicsComplexVectorString(), and valueExtract().
HELICS_CXX_EXPORT std::complex< double > helics::helicsGetComplex | ( | const std::string & | val | ) |
convert a string to a complex number
References helicsGetComplex().
Referenced by getComplexFromString(), helicsGetComplex(), helicsGetComplexVector(), helicsGetNamedPoint(), and helics::apps::PhasorGenerator::setString().
HELICS_CXX_EXPORT std::vector< std::complex< double > > helics::helicsGetComplexVector | ( | const std::string & | val | ) |
convert a string to a complex vector
References helicsGetComplexVector().
Referenced by helicsGetComplexVector(), and valueExtract().
HELICS_CXX_EXPORT void helics::helicsGetComplexVector | ( | const std::string & | val, |
std::vector< std::complex< double >> & | data | ||
) |
convert a string to a complex vector using an existing vector
References data, helicsGetComplex(), helicsGetComplexVector(), and invalidValue().
HELICS_CXX_EXPORT NamedPoint helics::helicsGetNamedPoint | ( | const std::string & | val | ) |
convert a string to a named point
References getDoubleFromString(), helicsGetComplex(), helicsGetNamedPoint(), invalidDouble, helics::NamedPoint::name, and helics::NamedPoint::value.
Referenced by helicsGetNamedPoint(), and valueExtract().
HELICS_CXX_EXPORT std::vector< double > helics::helicsGetVector | ( | const std::string & | val | ) |
convert a string to a vector
References helicsGetVector().
Referenced by getComplexFromString(), helicsGetVector(), and valueExtract().
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().
|
constexpr |
template function for generating a known name of a type
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().
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().
void helics::insertProtocol | ( | std::string & | networkAddress, |
interface_type | 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().
|
inline |
generate an invalid value for the various types
Referenced by helicsGetComplexVector().
|
inline |
function to check if the size is valid for the given type
References isBlockSizeValid(), and helics::publication_info::size.
Referenced by isBlockSizeValid().
|
noexcept |
Returns true if core/broker type specified is available in current compilation.
|
inlinenoexcept |
check if a command is a disconnect command
|
inlinenoexcept |
check if a command is a disconnect command
bool helics::isipv6 | ( | const std::string & | address | ) |
check if a specified address is v6 or v4
Referenced by getLocalExternalAddress().
|
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().
|
inlinenoexcept |
check if a command is a protocol command
Referenced by helics::NetworkCommsInterface::generateReplyToIncomingMessage().
|
inlinenoexcept |
check if a command is a valid command
References helics::action_message_def::cmd_invalid.
|
inline |
helper template to check whether an index is actually valid for a particular vector
SizedDataType | a vector like data type that must have a size function |
testSize | an index to test |
vec | a reference to a vector like object that has a size method |
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().
bool helics::loadCores | ( | ) |
load the available core and Broker types into the factory
HELICS_CXX_EXPORT FederateInfo helics::loadFederateInfo | ( | const std::string & | configString | ) |
generate a FederateInfo object from a config file or string (JSON, TOML)
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"
invalid_argument | if the string is not a valid time |
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"
timeString | the string containing the time |
defUnit | the units to apply to a string with no other units specified |
invalid_argument | if the string is not a valid time |
|
constexpr |
constant to use for indicating that a command is for the core itself from the Core Public API
Referenced by helics::CoreFactory::abortAllCores(), helics::CommonCore::getFlagOption(), helics::CommonCore::getIntegerProperty(), helics::CoreApp::globalError(), helics::CoreApp::haltInit(), helicsCoreGlobalError(), helics::CommonCore::logMessage(), helics::CommonCore::setCoreReadyToInit(), helics::CommonCore::setFlagOption(), helics::CommonCore::setIntegerProperty(), and helics::CommonCore::setLoggingCallback().
HELICS_CXX_EXPORT std::unique_ptr< CloningFilter > helics::make_cloning_filter | ( | filter_types | type, |
Core * | cr, | ||
const std::string & | delivery, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a cloning filter with a delivery location
type | the type of filter to create |
cr | the core to create the filter through |
delivery | the endpoint to deliver the cloned message to |
name | the name of the filter (optional) |
References addOperations().
HELICS_CXX_EXPORT std::unique_ptr< CloningFilter > helics::make_cloning_filter | ( | filter_types | type, |
CoreApp & | cr, | ||
const std::string & | delivery, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a cloning filter with a delivery location
type | the type of filter to create |
cr | the core to create the filter through |
delivery | the endpoint to deliver the cloned message to |
name | the name of the filter (optional) |
References helics::CoreApp::getCopyofCorePointer(), and make_cloning_filter().
HELICS_CXX_EXPORT CloningFilter & helics::make_cloning_filter | ( | filter_types | type, |
Federate * | fed, | ||
const std::string & | delivery, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a filter
type | the type of filter to create |
fed | the federate to create the filter through |
delivery | the endpoint to deliver the cloned message to |
name | the name of the filter (optional) |
References addOperations(), helics::Federate::getCorePointer(), and helics::Federate::registerCloningFilter().
Referenced by make_cloning_filter(), and helics::FilterFederateManager::registerCloningFilter().
HELICS_CXX_EXPORT CloningFilter & helics::make_cloning_filter | ( | interface_visibility | locality, |
filter_types | type, | ||
Federate * | fed, | ||
const std::string & | delivery, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a cloning filter with a specified visibility
locality | can be global or local |
type | the type of filter to create |
fed | the federate to create the filter through |
delivery | the endpoint to deliver the cloned message to |
name | the name of the filter (optional) |
HELICS_CXX_EXPORT std::unique_ptr< Filter > helics::make_filter | ( | filter_types | type, |
Core * | cr, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a filter
type | the type of filter to create |
cr | the core to create the filter through |
name | the name of the filter (optional) |
HELICS_CXX_EXPORT std::unique_ptr< Filter > helics::make_filter | ( | filter_types | type, |
CoreApp & | cr, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a filter
type | the type of filter to create |
cr | the core to create the filter through |
name | the name of the filter (optional) |
References helics::CoreApp::getCopyofCorePointer(), and make_filter().
HELICS_CXX_EXPORT Filter & helics::make_filter | ( | filter_types | type, |
Federate * | fed, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a filter
type | the type of filter to create |
fed | the federate to create the filter through |
name | the name of the filter (optional) |
Referenced by make_filter(), and helics::FilterFederateManager::registerFilter().
HELICS_CXX_EXPORT Filter & helics::make_filter | ( | interface_visibility | locality, |
filter_types | type, | ||
Federate * | fed, | ||
const std::string & | name = EMPTY_STRING |
||
) |
create a filter
locality | the visibility of the filter global or local |
type | the type of filter to create |
fed | the federate to create the filter through |
name | the name of the filter (optional) |
std::enable_if_t<helicsType<X>) != data_type::helics_custom, std::unique_ptr<Publication> > helics::make_publication | ( | FedPtr & | valueFed, |
const std::string & | key, | ||
const std::string & | units = std::string() |
||
) |
create a pointer to a publication
X | is the type of the publication |
FedPtr | a pointer a value Federate |
valueFed | pointer to a valid federate |
key | the identifier for the publication |
units | optional units for the publication |
std::enable_if_t<helicsType<X>) != data_type::helics_custom, std::unique_ptr<Publication> > helics::make_publication | ( | interface_visibility | locality, |
FedPtr & | valueFed, | ||
const std::string & | key, | ||
const std::string & | units = std::string() |
||
) |
create a pointer to a publication
X | is the type of the publication |
FedPtr | a pointer a value Federate |
locality | either LOCAL or GLOBAL defining whether the federate name is prepended or not |
valueFed | pointer to a valid federate |
key | the identifier for the publication |
units | optional units for the publication |
std::enable_if_t<helicsType<X>) != data_type::helics_custom, std::unique_ptr<Publication> > helics::make_publication | ( | interface_visibility | locality, |
ValueFederate * | valueFed, | ||
const std::string & | key, | ||
const std::string & | units = std::string() |
||
) |
create a pointer to a publication
X | is the type of the publication |
locality | either LOCAL or GLOBAL defining whether the federate name is prepended or not |
valueFed | pointer to a valid federate |
key | the identifier for the publication |
units | optional units for the publication |
std::enable_if_t<helicsType<X>) != data_type::helics_custom, std::unique_ptr<Publication> > helics::make_publication | ( | ValueFederate * | valueFed, |
const std::string & | key, | ||
const std::string & | units = std::string() |
||
) |
create a pointer to a publication
X | is the type of the publication |
valueFed | pointer to a valid federate |
key | the identifier for the publication |
units | optional units for the publication |
|
inline |
generate a subscription object from a value federate
generate a typed subscription object from a value federate
References helics::ValueFederate::registerSubscription().
|
inline |
generate a subscription object from a value federate
generate a typed subscription object from a value federate
References helics::ValueFederate::registerSubscription().
Referenced by helics::apps::Tracer::addSubscription().
|
inline |
directly convert the boolean to integer
|
inline |
directly convert the boolean to integer
decltype(auto) helics::make_valid | ( | X && | obj | ) |
this template should do nothing for most classes the specific overloads are the important ones
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
networkInterface | a string with an interface description i.e 127.0.0.1 |
portNumber | the number of the port to use |
Referenced by helics::NetworkBroker< ZmqComms, interface_type::tcp, 1 >::generateLocalAddressString(), helics::NetworkCore< ZmqComms, interface_type::tcp >::generateLocalAddressString(), and helics::NetworkCommsInterface::getAddress().
|
inline |
operator to check if two data blocks are not equal to each other
|
constexpr |
user defined literal for a time variable
std::ostream & helics::operator<< | ( | std::ostream & | os, |
const ActionMessage & | command | ||
) |
stream operator for a command
References prettyPrintString().
std::ostream & helics::operator<< | ( | std::ostream & | os, |
global_broker_id | id | ||
) |
stream operator for a federate_id
std::ostream & helics::operator<< | ( | std::ostream & | os, |
global_federate_id | id | ||
) |
stream operator for a federate_id
std::ostream & helics::operator<< | ( | std::ostream & | os, |
global_handle | id | ||
) |
stream operator for a federate_id
std::string helics::prettyPrintString | ( | const ActionMessage & | command | ) |
generate a human readable string with information about a command
command | the command to generate the string for |
References helics::ActionMessage::action(), actionMessageType(), helics::ActionMessage::actionTime, helics::interface_handle::baseValue(), helics::global_federate_id::baseValue(), checkActionFlag(), helics::ActionMessage::dest_handle, helics::ActionMessage::dest_id, error_flag, helics::ActionMessage::name, helics::ActionMessage::payload, helics::ActionMessage::source_handle, helics::ActionMessage::source_id, helics::ActionMessage::Tdemin, and helics::ActionMessage::Te.
Referenced by operator<<(), and helics::CommonCore::sendMessage().
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
high | addresses that should be considered before low addresses |
low | addresses that should be considered last |
Referenced by getLocalExternalAddressV4(), and getLocalExternalAddressV6().
void helics::publish | ( | ValueFederate & | fed, |
const std::string & | pubKey, | ||
Us... | pargs | ||
) |
publish directly from the publication key name
this is a convenience function to publish directly from the publication key 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
fed | a reference to a valueFederate |
pubKey | the name of the publication |
pargs | any combination of arguments that go into the other publish commands |
References fed.
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
fed | a pointer to the federate |
fedName | the name of the federate we are querying |
References fed, and helics_sequencing_mode_ordered.
void helics::removeProtocol | ( | std::string & | networkAddress | ) |
strip any protocol strings from the interface and return a new string
Referenced by helics::NetworkCommsInterface::loadNetworkInfo().
|
inline |
function to check if the message processing result should be returned or processing continued
References next_step.
void helics::setIterationFlags | ( | ActionMessage & | command, |
iteration_request | iterate | ||
) |
set the flags for an iteration request
References force_iteration, iterate_if_needed, iteration_requested_flag, no_iterations, required_flag, and setActionFlag().
Referenced by helics::CommonCore::enterExecutingMode(), helics::FederateState::enterExecutingMode(), helics::TimeCoordinator::enteringExecMode(), and helics::CommonCore::requestTimeIterative().
const std::string & helics::state_string | ( | operation_state | state | ) |
function to print string for the state
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().
HELICS_CXX_EXPORT time_units helics::timeUnitsFromString | ( | const std::string & | unitString | ) |
generate a time related unit,
invalid_argument | if the string is not a valid unit |
HELICS_CXX_EXPORT std::string helics::to_string | ( | core_type | type | ) |
generate a string based on the core type
HELICS_CXX_EXPORT data_block helics::typeConvert | ( | data_type | type, |
double | val | ||
) |
convert a value to a data block to be interpreted using the specified type
type | the type used for the data conversion |
val | a double to convert |
References generateJsonString(), typeConvert(), and typeNameStringRef().
Referenced by helics::Publication::publish(), and typeConvert().
|
inlineconstexpr |
template class for generating a known name of a type
|
inlineconstexpr |
for boolean
|
inlineconstexpr |
for character
|
inlineconstexpr |
for float
|
inlineconstexpr |
for float
|
inlineconstexpr |
for 64 bit unsigned integer
|
inlineconstexpr |
for complex double
|
inlineconstexpr |
for complex double
|
inlineconstexpr |
for integer
|
inlineconstexpr |
for unsigned integer
|
inlineconstexpr |
for 64 bit unsigned integer
|
inlineconstexpr |
for unsigned character
const HELICS_CXX_EXPORT std::string & helics::typeNameStringRef | ( | data_type | type | ) |
sometimes we just need a ref to a string for the basic types
References typeNameStringRef().
Referenced by helicsFederateRegisterGlobalInput(), helicsFederateRegisterGlobalPublication(), helicsFederateRegisterInput(), helicsFederateRegisterPublication(), typeConvert(), and typeNameStringRef().
std::enable_if_t<std::is_arithmetic<X>::value> helics::valueExtract | ( | const data_view & | dv, |
data_type | baseType, | ||
X & | val | ||
) |
assume it is some numeric type (int or double)
HELICS_CXX_EXPORT void helics::valueExtract | ( | const defV & | dv, |
bool & | val | ||
) |
extract the value from a variant to a bool
References helicsBoolValue(), and vectorNorm().
HELICS_CXX_EXPORT void helics::valueExtract | ( | const defV & | dv, |
char & | val | ||
) |
extract the value from a variant to a character
HELICS_CXX_EXPORT void helics::valueExtract | ( | const defV & | dv, |
NamedPoint & | val | ||
) |
extract the value from a variant to a named point
References helicsComplexString(), helicsComplexVectorString(), helicsGetNamedPoint(), helicsVectorString(), helics::NamedPoint::name, and helics::NamedPoint::value.
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().
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().
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().
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().
extract the value from a variant to a named point
References timeZero.
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(), and vectorNorm().
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().
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().
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
References vectorizeQueryResult().
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
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(), and vectorizeIndexQuery().
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().
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().
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
fed | a pointer to the federate |
fedName | the name of the federate we are querying |
timeout | the amount of time in ms to wait before returning false |
References fed.
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
fed | a pointer to the federate |
fedName | the name of the federate we are querying |
timeout | the time to wait for the fed to initialize |
References fed, and helics_sequencing_mode_ordered.
|
constexpr |
build flags used to compile helics
Referenced by helicsGetBuildFlags().
|
constexpr |
compiler used to build helics
Referenced by helicsGetCompilerVersion().
|
constexpr |
|
constexpr |
|
constexpr |
identifier to target the local core even if the global id hasn't been assigned yet
Referenced by helics::CommonCore::query(), and helics::CommonCore::setGlobal().
|
constexpr |
a shift in the global id index to discriminate between global ids of brokers vs federates
|
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
|
constexpr |
common definition of currentTime in initialization mode
Referenced by helics::Federate::enterExecutingMode(), helics::FederateState::enterExecutingMode(), helics::Federate::enterExecutingModeComplete(), helics::MessageFederateManager::initializeToExecuteStateTransition(), and helics::ValueFederateManager::initializeToExecuteStateTransition().
|
constexpr |
defining an invalid id value
|
constexpr |
definition of the smallest negative increment of time
|
constexpr |
constant to use for indicating that a command is for the core itself from the Core Public API
Referenced by helics::ForwardingTimeCoordinator::checkExecEntry(), helics::TimeCoordinator::checkExecEntry(), helics::FilterFederate::createFilter(), helics::CommonCore::processDisconnect(), helics::FilterFederate::processMessageFilter(), helics::CommonCore::query(), helics::CommonCore::registerFederate(), helics::BrokerBase::saveProfilingData(), helics::BrokerBase::sendToLogger(), and helics::TimeoutMonitor::tick().
|
constexpr |
constant to use for indicating the id of the root broker
Referenced by helics::CommonCore::setGlobal().
|
constexpr |
definition of the minimum time resolution
Referenced by helics::apps::Source::runTo().
|
constexpr |
constexpr definition for starting time
Referenced by helics::FederateState::addAction(), helics::ForwardingTimeCoordinator::checkExecEntry(), helics::TimeCoordinator::checkExecEntry(), helics::Message::clear(), helics::BrokerBase::configureBase(), helics::Federate::enterExecutingMode(), helics::FederateState::enterExecutingMode(), helics::Federate::enterExecutingModeComplete(), helics::ActionMessage::fromByteArray(), helics::TimeCoordinator::generateConfig(), helics::MessageFederateManager::initializeToExecuteStateTransition(), helics::ValueFederateManager::initializeToExecuteStateTransition(), helics::Federate::requestNextStep(), helics::CommonCore::requestTimeIterative(), helics::apps::Recorder::runTo(), helics::apps::Clone::runTo(), helics::apps::Player::runTo(), helics::apps::Source::runTo(), helics::DelayFilterOperation::set(), helics::BrokerBase::setErrorState(), helics::CommonCore::setTimeProperty(), helics::TimeCoordinator::updateMessageTime(), helics::TimeCoordinator::updateValueTime(), and valueExtract().
|
constexpr |
|
constexpr |
the build string if any
|
constexpr |
get the Major version number
|
constexpr |
get the Minor version number
|
constexpr |
get the patch number
|
constexpr |
a string representation of the HELICS version
Referenced by helicsGetVersion().