DataStorm  0.1
Data Distribution Service
Classes | Typedefs | Enumerations | Functions
DataStorm Namespace Reference

Classes

struct  Cloner
 The Cloner template provides a method to clone user types. More...
 
struct  Cloner< std::shared_ptr< T >, typename std::enable_if< std::is_base_of<::Ice::Value, T >::value >::type >
 Cloner template specialization to clone shared Ice values using ice_clone.
 
class  Config
 The configuration base class holds configuration options common to readers and writers. More...
 
class  CtrlCHandler
 Provides a portable way to handle Ctrl-C and Ctrl-C like signals. More...
 
struct  Decoder
 The Decoder template provides a method to decode user types. More...
 
struct  Decoder< T, typename std::enable_if< std::is_base_of<::Ice::Value, T >::value >::type >
 Decoder template specilization to decode Ice::Value instances.
 
struct  Encoder
 The Encoder template provides a method to encode decode user types. More...
 
struct  Encoder< T, typename std::enable_if< std::is_base_of<::Ice::Value, T >::value >::type >
 Encoder template specilization to encode Ice::Value instances.
 
struct  Filter
 Filter structure to specify the filter name and criteria value. More...
 
class  FilteredKeyReader
 The filtered reader to read data elements whose key match a given filter. More...
 
class  MultiKeyReader
 The key reader to read the data element associated with a given set of keys. More...
 
class  MultiKeyWriter
 The key writer to write data elements associated with a given set of keys. More...
 
class  Node
 The Node class allows creating topic readers and writers. More...
 
class  NodeShutdownException
 The exception NodeShutdownException. More...
 
class  Reader
 The Reader class is used to retrieve samples for a data element. More...
 
class  ReaderConfig
 The ReaderConfig class specifies configuration options specific to readers. More...
 
class  Sample
 A sample provides information about a data element update. More...
 
class  SingleKeyReader
 The key reader to read the data element associated with a given key. More...
 
class  SingleKeyWriter
 The key writer to write the data element associated with a given key. More...
 
class  Topic
 The Topic class. More...
 
class  Writer
 The writer class is used to write samples for a data element. More...
 
class  WriterConfig
 The WriterConfig class specifies configuration options specific to writers. More...
 

Typedefs

using CtrlCHandlerCallback = std::function< void(int sig)>
 Invoked when a signal occurs. More...
 

Enumerations

enum  DiscardPolicy { DiscardPolicy::None, DiscardPolicy::SendTime, DiscardPolicy::Priority }
 The discard policy specifies how samples are discarded by readers upon receival. More...
 
enum  ClearHistoryPolicy {
  ClearHistoryPolicy::OnAdd, ClearHistoryPolicy::OnRemove, ClearHistoryPolicy::OnAll, ClearHistoryPolicy::OnAllExceptPartialUpdate,
  ClearHistoryPolicy::Never
}
 The clear history policy specifies when the history is cleared. More...
 
enum  CallbackReason { CallbackReason::Connect, CallbackReason::Disconnect }
 The callback action enumurator specifies the reason why a callback is called. More...
 

Functions

std::ostream & operator<< (std::ostream &os, SampleEvent sampleType)
 Convert the given sample type to a string and add it to the stream. More...
 
std::ostream & operator<< (std::ostream &os, const std::vector< SampleEvent > &types)
 Convert the given sample type vector to a string and add it to the stream. More...
 
template<typename K , typename V , typename U >
std::ostream & operator<< (std::ostream &os, const Sample< K, V, U > &sample)
 Convert the given sample to a string and add it to the stream. More...
 
template<typename K , typename V , typename UT >
SingleKeyReader< K, V, UT > makeSingleKeyReader (const Topic< K, V, UT > &topic, const typename Topic< K, V, UT >::KeyType &key, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept
 Creates a key reader for the given topic and key. More...
 
template<typename SFC , typename K , typename V , typename UT >
SingleKeyReader< K, V, UT > makeSingleKeyReader (const Topic< K, V, UT > &topic, const typename Topic< K, V, UT >::KeyType &key, const Filter< SFC > &sampleFilter, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept
 Creates a key reader for the given topic, key and sample filter. More...
 
template<typename K , typename V , typename UT >
MultiKeyReader< K, V, UT > makeMultiKeyReader (const Topic< K, V, UT > &topic, const std::vector< typename Topic< K, V, UT >::KeyType > &keys, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept
 Creates a multi-key reader for the given topic. More...
 
template<typename SFC , typename K , typename V , typename UT >
MultiKeyReader< K, V, UT > makeMultiKeyReader (const Topic< K, V, UT > &topic, const std::vector< typename Topic< K, V, UT >::KeyType > &keys, const Filter< SFC > &sampleFilter, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept
 Creates a multi-key reader for the given topic, keys and sample filter. More...
 
template<typename K , typename V , typename UT >
MultiKeyReader< K, V, UT > makeAnyKeyReader (const Topic< K, V, UT > &topic, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept
 Creates an any-key reader for the given topic. More...
 
template<typename SFC , typename K , typename V , typename UT >
MultiKeyReader< K, V, UT > makeAnyKeyReader (const Topic< K, V, UT > &topic, const Filter< SFC > &sampleFilter, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig()) noexcept
 Creates an any-key reader for the given topic and sample filter. More...
 
template<typename KFC , typename K , typename V , typename UT >
FilteredKeyReader< K, V, UT > makeFilteredKeyReader (const Topic< K, V, UT > &topic, const Filter< KFC > &filter, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig())
 Creates a new filtered reader for the given topic and key filter. More...
 
template<typename KFC , typename SFC , typename K , typename V , typename UT >
FilteredKeyReader< K, V, UT > makeFilteredKeyReader (const Topic< K, V, UT > &topic, const Filter< KFC > &keyFilter, const Filter< SFC > &sampleFilter, const std::string &name=std::string(), const ReaderConfig &config=ReaderConfig())
 Creates a new filter reader for the given topic, key filter and sample filter. More...
 
template<typename K , typename V , typename UT >
SingleKeyWriter< K, V, UT > makeSingleKeyWriter (const Topic< K, V, UT > &topic, const typename Topic< K, V, UT >::KeyType &key, const std::string &name=std::string(), const WriterConfig &config=WriterConfig()) noexcept
 Creates a key writer for the given topic and key. More...
 
template<typename K , typename V , typename UT >
MultiKeyWriter< K, V, UT > makeMultiKeyWriter (const Topic< K, V, UT > &topic, const std::vector< typename Topic< K, V, UT >::KeyType > &keys, const std::string &name=std::string(), const WriterConfig &config=WriterConfig()) noexcept
 Creates a multi-key writer for the given topic and keys. More...
 
template<typename K , typename V , typename UT >
MultiKeyWriter< K, V, UT > makeAnyKeyWriter (const Topic< K, V, UT > &topic, const std::string &name=std::string(), const WriterConfig &config=WriterConfig()) noexcept
 Creates an any-key writer for the given topic. More...
 

Typedef Documentation

◆ CtrlCHandlerCallback

using DataStorm::CtrlCHandlerCallback = typedef std::function<void(int sig)>

Invoked when a signal occurs.

The callback must not raise exceptions. On Linux and macOS, the callback is NOT a signal handler and can call functions that are not async-signal safe.

Parameters
sigThe signal number that occurred.

Enumeration Type Documentation

◆ CallbackReason

The callback action enumurator specifies the reason why a callback is called.

Enumerator
Connect 

The callback is called because of connection.

Disconnect 

The callback is called because of a disconnection.

◆ ClearHistoryPolicy

The clear history policy specifies when the history is cleared.

The history can be cleared based on the event of the received sample.

Enumerator
OnAdd 

Clear the sample history when a Add sample is received.

OnRemove 

Clear the sample history when a Remove sample is received.

OnAll 

Clear the sample history when a new sample is received.

OnAllExceptPartialUpdate 

Clear the sample history when a new sample which is not a partial update is received.

Never 

Never clear the sample history.

◆ DiscardPolicy

The discard policy specifies how samples are discarded by readers upon receival.

Enumerator
None 

Samples are never discarded.

SendTime 

Samples are discared based on the sample timestamp.

If the received sample timestamp is older than that last received sample, the sample is discarded. This ensures that readers will eventually always end up with the same view of the data if multiple writers are sending samples.

Priority 

Samples are discarded based on the writer priority.

Only samples from the highest priority connected writers are kept, others are discarded.

Function Documentation

◆ makeAnyKeyReader() [1/2]

template<typename K , typename V , typename UT >
MultiKeyReader<K, V, UT> DataStorm::makeAnyKeyReader ( const Topic< K, V, UT > &  topic,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)
noexcept

Creates an any-key reader for the given topic.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

The reader will receive samples for any keys from the topic.

Parameters
topicThe topic.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeAnyKeyReader() [2/2]

template<typename SFC , typename K , typename V , typename UT >
MultiKeyReader<K, V, UT> DataStorm::makeAnyKeyReader ( const Topic< K, V, UT > &  topic,
const Filter< SFC > &  sampleFilter,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)
noexcept

Creates an any-key reader for the given topic and sample filter.

This helper method deduces the topic Key and Value types from the topic argument.

The reader will receive samples for the keys from the topic.

Parameters
topicThe topic.
sampleFilterThe sample filter.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeAnyKeyWriter()

template<typename K , typename V , typename UT >
MultiKeyWriter<K, V, UT> DataStorm::makeAnyKeyWriter ( const Topic< K, V, UT > &  topic,
const std::string &  name = std::string(),
const WriterConfig config = WriterConfig() 
)
noexcept

Creates an any-key writer for the given topic.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

Parameters
topicThe topic.
nameThe optional writer name.
configThe optional writer configuration.

◆ makeFilteredKeyReader() [1/2]

template<typename KFC , typename K , typename V , typename UT >
FilteredKeyReader<K, V, UT> DataStorm::makeFilteredKeyReader ( const Topic< K, V, UT > &  topic,
const Filter< KFC > &  filter,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)

Creates a new filtered reader for the given topic and key filter.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

Parameters
topicThe topic.
filterThe key filter.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeFilteredKeyReader() [2/2]

template<typename KFC , typename SFC , typename K , typename V , typename UT >
FilteredKeyReader<K, V, UT> DataStorm::makeFilteredKeyReader ( const Topic< K, V, UT > &  topic,
const Filter< KFC > &  keyFilter,
const Filter< SFC > &  sampleFilter,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)

Creates a new filter reader for the given topic, key filter and sample filter.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

Parameters
topicThe topic.
keyFilterThe key filter.
sampleFilterThe sample filter.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeMultiKeyReader() [1/2]

template<typename K , typename V , typename UT >
MultiKeyReader<K, V, UT> DataStorm::makeMultiKeyReader ( const Topic< K, V, UT > &  topic,
const std::vector< typename Topic< K, V, UT >::KeyType > &  keys,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)
noexcept

Creates a multi-key reader for the given topic.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

The reader will only receive samples for the given set of keys.

Parameters
topicThe topic.
keysThe keys.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeMultiKeyReader() [2/2]

template<typename SFC , typename K , typename V , typename UT >
MultiKeyReader<K, V, UT> DataStorm::makeMultiKeyReader ( const Topic< K, V, UT > &  topic,
const std::vector< typename Topic< K, V, UT >::KeyType > &  keys,
const Filter< SFC > &  sampleFilter,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)
noexcept

Creates a multi-key reader for the given topic, keys and sample filter.

This helper method deduces the topic Key and Value types from the topic argument.

The reader will only receive samples for the given set of keys.

Parameters
topicThe topic.
keysThe keys.
sampleFilterThe sample filter.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeMultiKeyWriter()

template<typename K , typename V , typename UT >
MultiKeyWriter<K, V, UT> DataStorm::makeMultiKeyWriter ( const Topic< K, V, UT > &  topic,
const std::vector< typename Topic< K, V, UT >::KeyType > &  keys,
const std::string &  name = std::string(),
const WriterConfig config = WriterConfig() 
)
noexcept

Creates a multi-key writer for the given topic and keys.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

Parameters
topicThe topic.
keysThe keys.
nameThe optional writer name.
configThe optional writer configuration.

◆ makeSingleKeyReader() [1/2]

template<typename K , typename V , typename UT >
SingleKeyReader<K, V, UT> DataStorm::makeSingleKeyReader ( const Topic< K, V, UT > &  topic,
const typename Topic< K, V, UT >::KeyType &  key,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)
noexcept

Creates a key reader for the given topic and key.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

Parameters
topicThe topic.
keyThe key.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeSingleKeyReader() [2/2]

template<typename SFC , typename K , typename V , typename UT >
SingleKeyReader<K, V, UT> DataStorm::makeSingleKeyReader ( const Topic< K, V, UT > &  topic,
const typename Topic< K, V, UT >::KeyType &  key,
const Filter< SFC > &  sampleFilter,
const std::string &  name = std::string(),
const ReaderConfig config = ReaderConfig() 
)
noexcept

Creates a key reader for the given topic, key and sample filter.

This helper method deduces the topic Key and Value types from the topic argument.

Parameters
topicThe topic.
keyThe key.
sampleFilterThe sample filter.
nameThe optional reader name.
configThe optional reader configuration.

◆ makeSingleKeyWriter()

template<typename K , typename V , typename UT >
SingleKeyWriter<K, V, UT> DataStorm::makeSingleKeyWriter ( const Topic< K, V, UT > &  topic,
const typename Topic< K, V, UT >::KeyType &  key,
const std::string &  name = std::string(),
const WriterConfig config = WriterConfig() 
)
noexcept

Creates a key writer for the given topic and key.

This helper method deduces the topic Key, Value and UpdateTag types from the topic argument.

Parameters
topicThe topic.
keyThe key.
nameThe optional writer name.
configThe optional writer configuration.

◆ operator<<() [1/3]

std::ostream& DataStorm::operator<< ( std::ostream &  os,
SampleEvent  sampleType 
)

Convert the given sample type to a string and add it to the stream.

Parameters
osThe output stream
sampleTypeThe sample type to add to the stream
Returns
The output stream

◆ operator<<() [2/3]

std::ostream& DataStorm::operator<< ( std::ostream &  os,
const std::vector< SampleEvent > &  types 
)

Convert the given sample type vector to a string and add it to the stream.

Parameters
osThe output stream
typesThe sample type vector to add to the stream
Returns
The output stream

◆ operator<<() [3/3]

template<typename K , typename V , typename U >
std::ostream& DataStorm::operator<< ( std::ostream &  os,
const Sample< K, V, U > &  sample 
)

Convert the given sample to a string and add it to the stream.

The implementation outputs the sample value.

Parameters
osThe output stream
sampleThe sample to add to the stream
Returns
The output stream