helics
3.5.2
|
#include <InputInfo.hpp>
Classes | |
struct | dataRecord |
struct | sourceInformation |
Public Member Functions | |
InputInfo (GlobalHandle handle, std::string_view key_, std::string_view type_, std::string_view units_) | |
const std::vector< std::shared_ptr< const SmallBuffer > > & | getAllData () const |
const std::shared_ptr< const SmallBuffer > & | getData (int index) const |
const std::shared_ptr< const SmallBuffer > & | getData (uint32_t *inputIndex) const |
bool | addData (GlobalHandle source_id, Time valueTime, unsigned int iteration, std::shared_ptr< const SmallBuffer > data) |
bool | updateTimeUpTo (Time newTime) |
bool | updateTimeInclusive (Time newTime) |
bool | updateTimeNextIteration (Time newTime) |
Time | nextValueTime () const |
bool | addSource (GlobalHandle newSource, std::string_view sourceName, std::string_view stype, std::string_view sunits) |
void | removeSource (GlobalHandle sourceToRemove, Time minTime) |
void | removeSource (std::string_view sourceName, Time minTime) |
void | disconnectFederate (GlobalFederateId fedToDisconnect, Time minTime) |
void | clearFutureData () |
const std::string & | getInjectionType () const |
const std::string & | getInjectionUnits () const |
const std::string & | getSourceName (GlobalHandle source) const |
const std::string & | getTargets () const |
void | setProperty (int32_t option, int32_t value) |
int32_t | getProperty (int32_t option) const |
Public Attributes | |
const GlobalHandle | id |
identifier for the handle | |
const std::string | key |
the identifier for the input | |
const std::string | type |
const std::string | units |
the nominal type of data for the input More... | |
bool | required {false} |
flag indicating that the subscription requires a matching publication | |
bool | optional {false} |
flag indicating that any targets are optional | |
bool | has_target {false} |
bool | only_update_on_change {false} |
flag indicating that the data should only be updated on change | |
bool | not_interruptible {false} |
indicator that this handle should not be used for interrupting | |
bool | strict_type_matching {false} |
indicator that the handle need to have strict type matching | |
bool | ignore_unit_mismatch {false} |
ignore unit mismatches | |
int32_t | required_connnections {0} |
Time | minTimeGap {timeZero} |
the minimum time between updates | |
std::vector< std::pair< helics::Time, unsigned int > > | current_data_time |
the most recent published data times | |
std::vector< std::shared_ptr< const SmallBuffer > > | current_data |
the most recent published data | |
std::vector< GlobalHandle > | input_sources |
the sources of the input signals | |
std::vector< Time > | deactivated |
indicator that the source has been deactivated | |
std::vector< sourceInformation > | source_info |
the name,type,units of the sources | |
std::vector< int32_t > | priority_sources |
the list of priority inputs; | |
data class for managing information about a subscription
|
inline |
constructor with all the information
bool helics::InputInfo::addData | ( | GlobalHandle | source_id, |
Time | valueTime, | ||
unsigned int | iteration, | ||
std::shared_ptr< const SmallBuffer > | data | ||
) |
add a data block into the queue
References current_data, current_data_time, helics::InputInfo::dataRecord::data, deactivated, input_sources, minTimeGap, only_update_on_change, and helics::timeZero.
bool helics::InputInfo::addSource | ( | GlobalHandle | newSource, |
std::string_view | sourceName, | ||
std::string_view | stype, | ||
std::string_view | sunits | ||
) |
add a new source target to the input
References current_data, current_data_time, deactivated, has_target, input_sources, and source_info.
void helics::InputInfo::clearFutureData | ( | ) |
clear all non-current data
void helics::InputInfo::disconnectFederate | ( | GlobalFederateId | fedToDisconnect, |
Time | minTime | ||
) |
disconnect a Federate
References deactivated, and input_sources.
const std::vector< std::shared_ptr< const SmallBuffer > > & helics::InputInfo::getAllData | ( | ) | const |
get all the current data
References current_data.
const std::shared_ptr< const SmallBuffer > & helics::InputInfo::getData | ( | int | index | ) | const |
get a particular data input
References current_data, and helics::isValidIndex().
const std::shared_ptr< const SmallBuffer > & helics::InputInfo::getData | ( | uint32_t * | inputIndex | ) | const |
get a the most recent data point
References current_data, current_data_time, and priority_sources.
const std::string & helics::InputInfo::getSourceName | ( | GlobalHandle | source | ) | const |
get the name of the source given a global id
References input_sources, and source_info.
Time helics::InputInfo::nextValueTime | ( | ) | const |
get the event based on the event queue
References not_interruptible.
void helics::InputInfo::removeSource | ( | GlobalHandle | sourceToRemove, |
Time | minTime | ||
) |
remove a source
References deactivated, and input_sources.
void helics::InputInfo::removeSource | ( | std::string_view | sourceName, |
Time | minTime | ||
) |
remove a source
References deactivated, key, and source_info.
bool helics::InputInfo::updateTimeInclusive | ( | Time | newTime | ) |
update current data to all new data at newTime
newTime | the time to move the subscription to |
bool helics::InputInfo::updateTimeNextIteration | ( | Time | newTime | ) |
update current data to get all data through the first iteration at newTime
newTime | the time to move the subscription to |
bool helics::InputInfo::updateTimeUpTo | ( | Time | newTime | ) |
update current data not including data at the specified time
newTime | the time to move the subscription to |
bool helics::InputInfo::has_target {false} |
flag indicating that the input has a source
Referenced by addSource().
int32_t helics::InputInfo::required_connnections {0} |
an exact number of connections required
const std::string helics::InputInfo::units |
the nominal type of data for the input
the units of the controlInput