33#include <NDEVR/ResourceListener.h>
62 void set(
const T& info,
bool check_equal =
true)
76 void set(T&& info,
bool check_equal =
true)
82 std::swap(m_value, info);
120 return value == m_value;
ResourceBase()
Constructs a default ResourceBase with no listeners.
void refreshListeners()
Notifies all registered listeners that the resource value has changed.
void getCopy(T ©) const
Copies the stored value into the provided output parameter.
Resource(const T &value)
Constructs a Resource with an initial value.
Resource(const Resource< T > &value)=delete
Copy constructor is deleted to enforce unique ownership.
Resource< T > & operator=(const Resource< T > &)=delete
Copy assignment is deleted to enforce unique ownership.
void set(const T &info, bool check_equal=true)
Destructor.
const T & get() const
Returns a const reference to the stored value.
void set(T &&info, bool check_equal=true)
Sets the stored value by move and notifies all listeners.
bool isEqualTo(const T &value) const
Checks whether the given value is equal to the stored value.
T & getModifiable()
Returns a mutable reference to the stored value without notifying listeners.
The primary namespace for the NDEVR SDK.