|
| MultiKeyReader (const Topic< Key, Value, UpdateTag > &topic, const std::vector< Key > &keys, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept |
| Construct a new reader for the given keys. More...
|
|
template<typename SampleFilterCriteria > |
| MultiKeyReader (const Topic< Key, Value, UpdateTag > &topic, const std::vector< Key > &keys, const Filter< SampleFilterCriteria > &sampleFilter, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept |
| Construct a new reader for the given keys and sample filter criteria. More...
|
|
| MultiKeyReader (MultiKeyReader &&reader) noexcept |
| Transfers the given reader to this reader. More...
|
|
MultiKeyReader & | operator= (MultiKeyReader &&reader) noexcept |
| Move assignement operator. More...
|
|
template<typename SFC > |
| MultiKeyReader (const Topic< Key, Value, UpdateTag > &topic, const std::vector< Key > &keys, const Filter< SFC > &sampleFilter, const std::string &name, const ReaderConfig &config) noexcept |
|
| Reader (Reader &&reader) noexcept |
| Transfers the given reader to this reader. More...
|
|
| ~Reader () |
| Destruct the reader. More...
|
|
Reader & | operator= (Reader &&reader) noexcept |
| Move assignement operator. More...
|
|
bool | hasWriters () const noexcept |
| Indicates whether or not writers are online. More...
|
|
void | waitForWriters (unsigned int count=1) const |
| Wait for given number of writers to be online. More...
|
|
void | waitForNoWriters () const |
| Wait for readers to be offline. More...
|
|
std::vector< std::string > | getConnectedWriters () const noexcept |
| Get the connected writers. More...
|
|
std::vector< Key > | getConnectedKeys () const noexcept |
| Get the keys for which writers are connected to this reader. More...
|
|
std::vector< Sample< Key, Value, UpdateTag > > | getAllUnread () noexcept |
| Returns all the unread samples. More...
|
|
void | waitForUnread (unsigned int count=1) const |
| Wait for given number of unread samples to be available. More...
|
|
bool | hasUnread () const noexcept |
| Returns wether or not unread samples are available. More...
|
|
Sample< Key, Value, UpdateTag > | getNextUnread () |
| Returns the next unread sample. More...
|
|
void | onConnectedKeys (std::function< void(std::vector< Key >)> init, std::function< void(CallbackReason, Key)> update) noexcept |
| Calls the given functions to provide the initial set of connected keys and when a key is added or removed from the set of connected keys. More...
|
|
void | onConnectedWriters (std::function< void(std::vector< std::string >)> init, std::function< void(CallbackReason, std::string)> update) noexcept |
| Calls the given functions to provide the initial set of connected writers and when a new writer connects or disconnects. More...
|
|
void | onSamples (std::function< void(std::vector< Sample< Key, Value, UpdateTag >>)> init, std::function< void(Sample< Key, Value, UpdateTag >)> queue) noexcept |
| Calls the given function to provide the initial set of unread samples and when new samples are queued. More...
|
|
template<typename Key, typename Value, typename UpdateTag = std::string>
class DataStorm::MultiKeyReader< Key, Value, UpdateTag >
The key reader to read the data element associated with a given set of keys.
template<typename Key, typename Value, typename UpdateTag = std::string>
template<typename SampleFilterCriteria >
Construct a new reader for the given keys and sample filter criteria.
The construction of the reader connects the reader to writers with matching keys. If an empty vector of keys is provided, the reader will connect to all the available writers. The writer will only send samples matching the given sample filter criteria to the reader.
- Parameters
-
topic | The topic. |
keys | The keys of the data elements to read. |
sampleFilter | The sample filter. |
name | The optional reader name. |
config | The reader configuration. |