| helics 3.6.1

Classes | Public Member Functions | Public Attributes | List of all members
helics::InputInfo Class Reference

`#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;

## Detailed Description

data class for managing information about a subscription

## Constructor & Destructor Documentation

## ◆ InputInfo()

helics::InputInfo::InputInfo | ( | GlobalHandle | handle,
|  | std::string_view | key_,
|  | std::string_view | type_,
|  | std::string_view | units_
| ) |  |
| inline

constructor with all the information

## Member Function Documentation

## ◆ addData()

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

Returns
  true if the data was accepted and added to queues

References current_data, current_data_time, helics::InputInfo::dataRecord::data, deactivated, input_sources, minTimeGap, only_update_on_change, and helics::timeZero.

## ◆ addSource()

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

Returns
  true if the source was added false if duplicate

References current_data, current_data_time, deactivated, has_target, input_sources, and source_info.

## ◆ clearFutureData()

void helics::InputInfo::clearFutureData | ( |  | ) |

clear all non-current data

## ◆ disconnectFederate()

void helics::InputInfo::disconnectFederate | ( | GlobalFederateId | fedToDisconnect,
|  | Time | minTime
| ) |  |

disconnect a Federate

References deactivated, and input_sources.

## ◆ getAllData()

const std::vector< std::shared_ptr< const SmallBuffer > > & helics::InputInfo::getAllData | ( |  | ) | const

get all the current data

References current_data.

## ◆ getData() [1/2]

const std::shared_ptr< const SmallBuffer > & helics::InputInfo::getData | ( | int | index | ) | const

get a particular data input

References current_data, and helics::isValidIndex().

## ◆ getData() [2/2]

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.

## ◆ getSourceName()

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.

## ◆ nextValueTime()

Time helics::InputInfo::nextValueTime | ( |  | ) | const

get the event based on the event queue

References not_interruptible.

## ◆ removeSource() [1/2]

void helics::InputInfo::removeSource | ( | GlobalHandle | sourceToRemove,
|  | Time | minTime
| ) |  |

remove a source

References deactivated, and input_sources.

## ◆ removeSource() [2/2]

void helics::InputInfo::removeSource | ( | std::string_view | sourceName,
|  | Time | minTime
| ) |  |

remove a source

References deactivated, key, and source_info.

## ◆ updateTimeInclusive()

bool helics::InputInfo::updateTimeInclusive | ( | Time | newTime | ) |

update current data to all new data at newTime

Parameters

  newTime | the time to move the subscription to

Returns
  true if the value has changed

## ◆ updateTimeNextIteration()

bool helics::InputInfo::updateTimeNextIteration | ( | Time | newTime | ) |

update current data to get all data through the first iteration at newTime

Parameters

  newTime | the time to move the subscription to

Returns
  true if the value has changed

## ◆ updateTimeUpTo()

bool helics::InputInfo::updateTimeUpTo | ( | Time | newTime | ) |

update current data not including data at the specified time

Parameters

  newTime | the time to move the subscription to

Returns
  true if the value has changed

## Member Data Documentation

## ◆ has_target

bool helics::InputInfo::has_target {false}

flag indicating that the input has a source

Referenced by addSource().

## ◆ required_connnections

int32_t helics::InputInfo::required_connnections {0}

an exact number of connections required

## ◆ units

const std::string helics::InputInfo::units

the nominal type of data for the input

the units of the controlInput

The documentation for this class was generated from the following files:

- InputInfo.hpp
- InputInfo.cpp