A dynamically typed reference to data with automatic memory management and read/write locking semantic.
More...
|
| Ref_any ()=default |
| Constructs a null reference.
|
|
| Ref_any (const Ref_any &other) noexcept |
| Copies an existing reference.
|
|
template<bool OR, bool OW> |
| Ref_any (const Ref_any< OR, OW > &other) noexcept |
| Copies an existing reference with different privileges.
|
|
| Ref_any (Ref_any &&other) noexcept |
| Moves an existing reference.
|
|
| Ref_any (void *data, std::function< void(void *)> freefunc, Datatype_sptr type, bool readable, bool writable) |
| Creates a reference to currently unreferenced data.
|
|
| ~Ref_any () |
| Destructor.
|
|
Ref_any & | operator= (Ref_any &&other) noexcept |
|
Ref_any & | operator= (const Ref_any &other) const noexcept |
|
bool | operator== (const Reference_base &o) const noexcept |
|
bool | operator!= (const Reference_base &o) const noexcept |
|
bool | operator< (const Reference_base &o) const noexcept |
|
bool | operator> (const Reference_base &o) const noexcept |
|
bool | operator<= (const Reference_base &o) const noexcept |
|
bool | operator>= (const Reference_base &o) const noexcept |
|
Ref | operator[] (const std::string &member_name) const |
| Create a sub-reference to a member in case the content behind the ref is a record.
|
|
Ref | operator[] (const char *member_name) const |
| Create a sub-reference to a member in case the content behind the ref is a record.
|
|
template<class T > |
std::enable_if_t< std::is_integral< T >::value, Ref > | operator[] (T index) const |
| Create a sub-reference to the content at a given index in case the content behind the ref is an array.
|
|
Ref | operator[] (std::pair< std::size_t, std::size_t > slice) const |
| Create a sub-reference to the content at a given slice in case the content behind the ref is an array.
|
|
Ref | dereference () const |
| Create a reference to the pointed content in case the ref type is a reference.
|
|
| operator ref_access_t< R, W > () const |
| Offers access to the referenced raw data.
|
|
ref_access_t< R, W > | get () const |
| Offers access to the referenced raw data, throws on null references.
|
|
ref_access_t< R, W > | get (std::nothrow_t) const noexcept |
| Offers access to the referenced raw data, returns null for null references.
|
|
template<class T > |
T | scalar_value () const |
| Returns a scalar value of type T taken from the data buffer.
|
|
| operator bool () const noexcept |
| Checks whether this is a null reference.
|
|
void | reset () noexcept |
| Nullify the reference.
|
|
Ref | copy () const |
| Makes a copy of the raw content behind this reference and returns a new reference.
|
|
void * | release () noexcept |
| Releases ownership of the referenced raw data by nullifying all existing references.
|
|
void | on_nullify (std::function< void(Ref)> notifier) const noexcept |
| Registers a nullification callback.
|
|
Datatype_sptr | type () const noexcept |
| accesses the type of the referenced raw data
|
|
size_t | hash () const noexcept |
|
template<bool R, bool W>
class PDI::Ref_any< R, W >
A dynamically typed reference to data with automatic memory management and read/write locking semantic.
Ref_any is a smart pointer that features:
- a dynamic type system,
- garbage collection mechanism similar to std::shared_ptr,
- a read/write locking mechanism similar to std::shared_mutex,
- a release system that nullifies all existing references to the raw data,
- a notification system to be notified when a reference is going to be nullified.