The object_ptr holds a pointer to an serializable. More...
#include <object_ptr.hpp>
Inherits matador::object_holder.
Public Types | |
typedef T | object_type |
typedef object_ptr< T > | self |
Public Member Functions | |
object_ptr ()=default | |
object_ptr (const self &x) | |
object_ptr (self &&x) noexcept | |
object_ptr (T *o) | |
object_ptr (std::nullptr_t) | |
object_ptr (object_proxy *proxy) | |
object_ptr & | operator= (T *x) |
object_ptr & | operator= (const self &x) |
Copy assignes an object_ptr from the given has_one object. | |
object_ptr & | operator= (self &&x) noexcept |
object_ptr & | operator= (std::nullptr_t) |
const char * | type () const override |
const T * | operator-> () const |
Return the pointer to the serializable of type T. | |
const T * | get () const |
Return the pointer to the serializable of type T. | |
T * | get () |
Return the pointer to the serializable of type T. | |
T * | modify () |
const T & | operator* () const |
Return the reference to the serializable of type T. | |
T & | operator* () |
Return the reference to the serializable of type T. | |
identifier | create_identifier () const override |
matador::object_holder | Public Member Functions inherited from|
bool | operator== (const object_holder &x) const |
bool | operator== (std::nullptr_t) const |
bool | operator!= (const object_holder &x) const |
bool | operator!= (std::nullptr_t) const |
operator bool () const noexcept | |
void | reset (object_proxy *proxy, cascade_type cascade) |
void | reset (object_proxy *proxy, cascade_type cascade, bool notify_foreign_relation) |
void | reset (object_holder &holder) |
void | reset (const identifier &id) override |
void | clear () |
bool | empty () const noexcept |
bool | valid () const noexcept |
bool | is_loaded () const |
unsigned long long | id () const |
object_store * | store () const |
void * | ptr () |
const void * | ptr () const |
void * | lookup_object () |
void * | lookup_object () const |
bool | is_internal () const |
bool | is_inserted () const |
bool | has_primary_key () const override |
const identifier & | primary_key () const override |
identifier & | primary_key () override |
unsigned long | reference_count () const |
cascade_type | cascade () const |
Additional Inherited Members | |
matador::object_holder | Protected Member Functions inherited from|
object_holder ()=default | |
Creates and empty base pointer. | |
object_holder (const object_holder &x) | |
object_holder (object_holder &&x) noexcept | |
object_holder & | operator= (const object_holder &x) |
object_holder & | operator= (object_holder &&x) noexcept |
object_holder (object_proxy *proxy) | |
Creates an object_holder with a given object_proxy. | |
~object_holder () override |
The object_ptr holds a pointer to an serializable.
T | The type of the serializable. |
The object_ptr holds a pointer to an object. The object_ptr is a wrapper class for the object class It has a reference count mechanism. The objects inserted into the object_store are returned as a object_ptr and should be used through the object_ptr class.
typedef T matador::object_ptr< T >::object_type |
Shortcut for serializable type.
typedef object_ptr<T> matador::object_ptr< T >::self |
Shortcut for self class.
|
default |
Create an empty object_ptr
|
inline |
Copies object_ptr
x | The object_ptr to copy |
|
inlinenoexcept |
Move constructor
x | object_ptr to move |
|
inline |
Create an object_ptr from an object
o | The object. |
|
inline |
Initializes the object_ptr with nullptr
|
inlineexplicit |
Create an object_ptr from an object_proxy
proxy | The object_proxy. |
|
inlineoverridevirtual |
Creates a new identifier, represented by the identifier of the underlying type.
Implements matador::identifiable_holder.
|
inline |
Return the pointer to the serializable of type T.
Return the pointer to the serializable of type T. If there isn't a valid serializable 0 (null) is returned.
|
inline |
Return the pointer to the serializable of type T.
Return the pointer to the serializable of type T. If there isn't a valid serializable 0 (null) is returned.
T * matador::object_ptr< T >::modify | ( | ) |
The modify method allows to modify the underlying object. It ensures that this object is marked as modified in the object_store and all registered observers are notified
|
inline |
Return the reference to the serializable of type T.
Return the reference to the serializable of type T. If there isn't a valid serializable 0 (null) is returned.
|
inline |
Return the reference to the serializable of type T.
Return the reference to the serializable of type T. If there isn't a valid serializable 0 (null) is returned.
|
inline |
Return the pointer to the serializable of type T.
Return the pointer to the serializable of type T. If there isn't a valid serializable 0 (null) is returned.
|
inline |
Copy assignes an object_ptr from the given has_one object.
x | The has_one object to created the object_ptr from |
|
inlinenoexcept |
Move assignment constructor
x | object_ptr to be moved |
|
inline |
Assigns nullptr to the object_ptr
|
inline |
Assign operator.
x | The x serializable to assign from. |
|
inlineoverridevirtual |
Return the type string of the object
Implements matador::object_holder.