Base class for the object pointer and reference class.
More...
#include <object_holder.hpp>
Inherits matador::identifiable_holder.
Inherited by matador::object_ptr< T >.
|
class | object_serializer |
|
class | object_proxy |
|
class | detail::object_deleter |
|
class | detail::object_inserter |
|
class | object_store |
|
class | abstract_container |
|
class | detail::object_proxy_accessor |
|
template<class T > |
class | container_item_holder |
|
template<class L , class R > |
class | has_many_to_many_item |
|
class | session |
|
template<class T > |
class | object_ptr |
|
struct | detail::basic_relation_endpoint |
|
MATADOR_OBJECT_API std::ostream & | operator<< (std::ostream &out, const object_holder &x) |
|
Base class for the object pointer and reference class.
This is the base class for the object pointer and reference class. The class holds the proxy of the object and the id of the object.
◆ object_holder() [1/4]
matador::object_holder::object_holder |
( |
| ) |
|
|
protecteddefault |
Creates and empty base pointer.
Creates and empty base pointer. The boolean tells the class if the object is handled as a reference or an pointer. The difference is that the reference couldn't be deleted from the object_store and the pointer can.
◆ object_holder() [2/4]
◆ object_holder() [3/4]
Copy move constructor
- Parameters
-
x | object holder to copy move |
◆ object_holder() [4/4]
matador::object_holder::object_holder |
( |
object_proxy * |
proxy | ) |
|
|
explicitprotected |
◆ ~object_holder()
matador::object_holder::~object_holder |
( |
| ) |
|
|
overrideprotected |
Destroys the object_holder and decides whether the underlying object_proxy is destroyed as well.
It is destroyed if it is not inserted into any object_store.
◆ cascade()
Returns the cascade type of the holder
- Returns
- The cascade type
◆ clear()
void matador::object_holder::clear |
( |
| ) |
|
Clears the currently set object
◆ empty()
bool matador::object_holder::empty |
( |
| ) |
const |
|
noexcept |
◆ has_primary_key()
bool matador::object_holder::has_primary_key |
( |
| ) |
const |
|
overridevirtual |
◆ id()
unsigned long long matador::object_holder::id |
( |
| ) |
const |
Returns the object id.
- Returns
- The id of the object.
◆ is_inserted()
bool matador::object_holder::is_inserted |
( |
| ) |
const |
Returns true if the underlying object is inserted in an object_store
- Returns
- True if object is inserted.
◆ is_internal()
bool matador::object_holder::is_internal |
( |
| ) |
const |
◆ is_loaded()
bool matador::object_holder::is_loaded |
( |
| ) |
const |
Returns if the object is loaded.
- Returns
- True if the object is loaded.
◆ lookup_object() [1/2]
void * matador::object_holder::lookup_object |
( |
| ) |
|
Returns the object pointer
- Returns
- The object pointer.
◆ lookup_object() [2/2]
void * matador::object_holder::lookup_object |
( |
| ) |
const |
Returns the object pointer
- Returns
- The object pointer.
◆ operator bool()
matador::object_holder::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
Returns true if holder holds a valid proxy/object.
- Returns
- True if proxy/object is not nullptr
◆ operator!=() [1/2]
bool matador::object_holder::operator!= |
( |
const object_holder & |
x | ) |
const |
Not equal to operator for the object_holder
- Parameters
-
- Returns
- True if the holder objects are not the same
◆ operator!=() [2/2]
bool matador::object_holder::operator!= |
( |
std::nullptr_t |
| ) |
const |
Checks equality with a nullptr
- Returns
- True if the holder objects isn't nullptr
◆ operator=() [1/2]
Assign operator.
- Parameters
-
◆ operator=() [2/2]
Assign move constructor
- Parameters
-
x | object holder to assign move |
- Returns
- The moved object holder
◆ operator==() [1/2]
bool matador::object_holder::operator== |
( |
const object_holder & |
x | ) |
const |
Equal to operator for the object_holder
- Parameters
-
- Returns
- True if the holder objects are the same
◆ operator==() [2/2]
bool matador::object_holder::operator== |
( |
std::nullptr_t |
| ) |
const |
Checks equality with a nullptr
- Returns
- True if the holder objects is nullptr
◆ primary_key() [1/2]
const identifier & matador::object_holder::primary_key |
( |
| ) |
const |
|
overridevirtual |
◆ primary_key() [2/2]
identifier & matador::object_holder::primary_key |
( |
| ) |
|
|
overridevirtual |
◆ ptr() [1/2]
void * matador::object_holder::ptr |
( |
| ) |
|
Returns the raw object pointer
- Returns
- The raw object pointer.
◆ ptr() [2/2]
const void * matador::object_holder::ptr |
( |
| ) |
const |
Returns the raw object pointer
- Returns
- The raw object pointer.
◆ reference_count()
unsigned long matador::object_holder::reference_count |
( |
| ) |
const |
Returns the current reference count
- Returns
- The current reference count
◆ reset() [1/4]
void matador::object_holder::reset |
( |
const identifier & |
id | ) |
|
|
overridevirtual |
◆ reset() [2/4]
Resets the object holder with the given object holder.
- Parameters
-
holder | The object holder to be used to reset |
◆ reset() [3/4]
void matador::object_holder::reset |
( |
object_proxy * |
proxy, |
|
|
cascade_type |
cascade |
|
) |
| |
Resets the object_holder with the given object_proxy.
- Parameters
-
proxy | The new object_proxy for the object_holder. |
cascade | Sets the cascade actions for the proxy. |
◆ reset() [4/4]
void matador::object_holder::reset |
( |
object_proxy * |
proxy, |
|
|
cascade_type |
cascade, |
|
|
bool |
notify_foreign_relation |
|
) |
| |
Resets the object_holder with the given object_proxy.
- Parameters
-
proxy | The new object_proxy for the object_holder. |
cascade | Sets the cascade actions for the proxy. |
notify_foreign_relation | True if foreign relation endpoint should be modified |
◆ store()
◆ type()
virtual const char * matador::object_holder::type |
( |
| ) |
const |
|
pure virtual |
◆ valid()
bool matador::object_holder::valid |
( |
| ) |
const |
|
noexcept |
◆ operator<<
MATADOR_OBJECT_API std::ostream & operator<< |
( |
std::ostream & |
out, |
|
|
const object_holder & |
x |
|
) |
| |
|
friend |
Prints the underlying object
- Parameters
-
out | The output stream to write on. |
x | The object pointer to print. |
- Returns
- The output stream.
The documentation for this class was generated from the following file:
- matador/object/object_holder.hpp