helics
3.5.2
|
#include <Subscriptions.hpp>
Public Member Functions | |
VectorSubscription (ValueFederate *valueFed, std::string_view key, int startIndex, int count, const X &defValue, std::string_view units=std::string_view{}) | |
template<class FedPtr > | |
VectorSubscription (FedPtr valueFed, std::string_view key, int startIndex, int count, const X &defValue, std::string_view units=std::string_view{}) | |
VectorSubscription (VectorSubscription &&vs) noexcept | |
VectorSubscription & | operator= (VectorSubscription &&vs) noexcept |
const std::vector< X > & | getVals () const |
const X & | operator[] (int index) const |
void | setInputNotificationCallback (std::function< void(int, Time)> callback) |
class to handle a Vector Subscription
X | the class of the value associated with the vector subscription |
|
inline |
constructor to build a subscription object
valueFed | the ValueFederate to use |
key | the identifier for the publication to subscribe to |
startIndex | the index to start with |
count | the number of values to subscribe to |
defValue | the default value |
units | the units associated with the Subscription |
|
inline |
constructor to build a subscription object
valueFed | the ValueFederate to use |
key | the identifier for the publication to subscribe to |
startIndex | the index to start with |
count | the number of values to subscribe to |
defValue | the default value |
units | the units associated with the Subscription |
|
inlinenoexcept |
move constructor
References helics::ValueFederate::setInputNotificationCallback().
|
inline |
get the most recent value
|
inlinenoexcept |
move assignment
References helics::ValueFederate::setInputNotificationCallback().
|
inline |
get a value through its index
|
inline |
register a callback for the update
the callback is called in the just before the time request function returns
callback | a function with signature void(X val, Time time) val is the new value and time is the time the value was updated |