Result
Result is a thin wrapper around std::vector and used for returning values from the detector. Since every module could have a different value, we need to return a vector instead of just a single value.
Easy conversions to single values are provided using the squash and tsquash method.
-
namespace sls
functions basic implemenation of shared memory
creates/destroys a thread
creates & manages a listener thread each
abstract for setting/getting properties of detector data
constructs the fifo structure
creates & manages a data streamer thread each
creates & manages a data processor thread each
creates/destroys an ARPing child process to arping the interfaces slsReceiver is listening to.
Functions
-
template<class T, class Allocator = std::allocator<T>>
class Result - #include <Result.h>
- Template Parameters
T – type to store in the result
Allocator – for the underlying vector, default
Public Types
Public Functions
-
Result() = default
-
template<typename V, typename = typename std::enable_if<std::is_integral<V>::value && (std::is_same<T, time::ns>::value || std::is_same<T, bool>::value)>::type>
inline Result(const Result<V> &from) Custom constructor from integer type to Result<ns> or Result<bool>
-
template<typename V, typename = typename std::enable_if<std::is_integral<V>::value && (std::is_same<T, time::ns>::value || std::is_same<T, bool>::value)>::type>
inline Result(Result<V> &from) Custom constructor from integer type to Result<ns> or Result<bool>
-
template<typename V, typename = typename std::enable_if<std::is_integral<V>::value && (std::is_same<T, time::ns>::value || std::is_same<T, bool>::value)>::type>
inline Result(Result<V> &&from) Custom constructor from integer type to Result<ns> or Result<bool>
-
template<typename ...Args>
inline Result(Args&&... args) Forward arguments to the constructor of std::vector
- Template Parameters
Args – template paramter pack to forward
-
inline const_reference operator[](size_type pos) const
-
inline T squash() const
If all elements are equal it returns the front value otherwise a default constructed T
-
inline T tsquash(const std::string &error_msg)
If all elements are equal it returns the front value otherwise throws an exception with custom message provided
-
inline T squash(const T &default_value) const
If all elements are equal return the front value, otherwise return the supplied default value
-
inline bool equal() const noexcept
Test whether all elements of the result are equal
-
inline bool any(const T &value) const noexcept
Test whether any element of the result are equal to a value
-
template<class T, class Allocator = std::allocator<T>>