helics
3.5.1
|
#include <Subscriptions.hpp>
Public Member Functions | |
template<class FedPtr > | |
VectorSubscription2d (FedPtr valueFed, std::string_view key, int startIndex_x, int count_x, int startIndex_y, int count_y, const X &defValue, std::string_view units=std::string_view()) | |
VectorSubscription2d & | operator= (VectorSubscription2d &&vs) noexcept |
const std::vector< X > & | getVals () const |
const X & | operator[] (int index) const |
const X & | at (int index_x, int index_y) 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_x | the index to start with in the x dimension |
count_x | the number of values in the x direction |
startIndex_y | the index to start with in the x dimension |
count_y | the number of values in the x direction |
defValue | the default value |
units | the units associated with the Subscription |
References helics::ValueFederate::registerIndexedSubscription(), and helics::ValueFederate::setInputNotificationCallback().
|
inline |
get the value in the given variable at a particular 2d index
|
inline |
get the most recent value
|
inlinenoexcept |
move assignment
References helics::ValueFederate::setInputNotificationCallback().
|
inline |
get the value in the given variable
index | the location to retrieve the value for |
|
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 |