![]() |
helics
2.8.1
|
#include <InputInfo.hpp>
Classes | |
struct | dataRecord |
struct | sourceInformation |
Public Member Functions | |
InputInfo (global_handle handle, const std::string &key_, const std::string &type_, const std::string &units_) | |
const std::vector< std::shared_ptr< const data_block > > & | getAllData () const |
const std::shared_ptr< const data_block > & | getData (int index) const |
const std::shared_ptr< const data_block > & | getData (uint32_t *inputIndex) const |
void | addData (global_handle source_id, Time valueTime, unsigned int iteration, std::shared_ptr< const data_block > data) |
bool | updateTimeUpTo (Time newTime) |
bool | updateTimeInclusive (Time newTime) |
bool | updateTimeNextIteration (Time newTime) |
Time | nextValueTime () const |
bool | addSource (global_handle newSource, const std::string &sourceName, const std::string &stype, const std::string &sunits) |
void | removeSource (global_handle sourceToRemove, Time minTime) |
void | removeSource (const std::string &sourceName, Time minTime) |
void | clearFutureData () |
const std::string & | getInjectionType () const |
const std::string & | getInjectionUnits () const |
const std::string & | getSourceName (global_handle source) const |
Public Attributes | |
const global_handle | 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 |
flag indicating that the subscription requires a matching publication More... | |
bool | optional {false} |
flag indicating that any targets are optional | |
bool | has_target {false} |
flag indicating that the input has a source | |
bool | only_update_on_change |
flag indicating that the data should only be updated on change More... | |
bool | not_interruptible |
indicator that this handle should not be used for interrupting More... | |
bool | strict_type_matching |
indicator that the handle need to have strict type matching More... | |
bool | ignore_unit_mismatch {false} |
ignore unit mismatches | |
int32_t | required_connnections {0} |
an exact number of connections required | |
std::vector< std::pair< helics::Time, unsigned int > > | current_data_time |
the most recent published data times | |
std::vector< std::shared_ptr< const data_block > > | current_data |
the most recent published data | |
std::vector< global_handle > | 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
void helics::InputInfo::addData | ( | global_handle | source_id, |
Time | valueTime, | ||
unsigned int | iteration, | ||
std::shared_ptr< const data_block > | data | ||
) |
add a data block into the queue
References data, deactivated, and input_sources.
bool helics::InputInfo::addSource | ( | global_handle | newSource, |
const std::string & | sourceName, | ||
const std::string & | stype, | ||
const std::string & | 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
const std::vector< std::shared_ptr< const data_block > > & helics::InputInfo::getAllData | ( | ) | const |
get all the current data
References current_data.
const std::shared_ptr< const data_block > & helics::InputInfo::getData | ( | int | index | ) | const |
get a particular data input
References current_data, and helics::isValidIndex().
const std::shared_ptr< const data_block > & 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 | ( | global_handle | 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 | ( | const std::string & | sourceName, |
Time | minTime | ||
) |
remove a source
References deactivated, key, and source_info.
void helics::InputInfo::removeSource | ( | global_handle | sourceToRemove, |
Time | minTime | ||
) |
remove a source
References deactivated, and input_sources.
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::not_interruptible |
indicator that this handle should not be used for interrupting
Referenced by nextValueTime().
bool helics::InputInfo::only_update_on_change |
flag indicating that the data should only be updated on change
bool helics::InputInfo::required |
flag indicating that the subscription requires a matching publication
bool helics::InputInfo::strict_type_matching |
indicator that the handle need to have strict type matching
const std::string helics::InputInfo::units |
the nominal type of data for the input
the units of the controlInput