|
bool | empty () const |
| Checks if the field is empty Empty is defined as having no member object pointer assigned to the Field object. See SimpleAny::empty()
|
|
cpp::FunctionKind | kind () const |
| Returns a reference to the member object pointer stored by the Field object. More...
|
|
template<typename T , typename = std::enable_if_t< std::is_member_object_pointer<std::decay_t<T>>::value >> |
| Field (T &&field) |
| Initializes a Field with a given member object pointer.
|
|
template<typename Object > |
decltype(auto) | get (const Object &object) const |
| Returns the value of the member object of a given object. More...
|
|
template<typename T , typename Object > |
decltype(auto) | getAs (const Object &object) const |
| Returns the value of the member object of a given object. More...
|
|
template<typename Object > |
decltype(auto) | get (Object &object) const |
| Returns the value of the member object of a given object. More...
|
|
template<typename T , typename Object > |
decltype(auto) | getAs (Object &object) const |
| Returns the value of the member object of a given object. More...
|
|
template<typename Storage_ > |
decltype(auto) | get (const cpp::SimpleAny< Storage_ > &object) const |
| Returns the value of the member object of a given type-erased object. More...
|
|
template<typename T , typename Storage_ > |
decltype(auto) | getAs (const cpp::SimpleAny< Storage_ > &object) const |
| Returns the value of the member object of a given type erased object. More...
|
|
template<typename Storage_ > |
decltype(auto) | get (cpp::SimpleAny< Storage_ > &object) const |
| Returns the value of the member object of a given type-erased object. More...
|
|
decltype(auto) | get (cpp::ReferenceSimpleAny &object) const |
| Returns the value of the member object of a given type-erased object reference. More...
|
|
decltype(auto) | get (cpp::ConstReferenceSimpleAny &object) const |
| Returns the value of the member object of a given type-erased object reference. More...
|
|
template<typename T , typename Storage_ > |
decltype(auto) | getAs (cpp::SimpleAny< Storage_ > &object) const |
| Returns the value of the member object of a given type erased object. More...
|
|
template<typename T > |
std::enable_if_t< std::is_member_object_pointer< std::decay_t< T > >::value, Field & > | operator= (T &&field) |
| Assigns a new member object pointer to the Field object.
|
|
template<typename T > |
const T & | get () const |
| Returns a reference to the member object pointer stored by the Field object. More...
|
|
template<typename T > |
T & | get () |
| Returns a reference to the member object pointer stored by the Field object. More...
|
|
template<typename Storage, typename ObjectArgStorage = Storage>
class cpp::typeerasure::Field< Storage, ObjectArgStorage >
Stores a type erased member object pointer.
Field class can store pointers to member objects of any class and type, suitable to be stored in an homogeneous context (Such as a vector). It also provides methods to access the type-erased pointer and access the member object of a given object
- Template Parameters
-
Storage | Storage for the member function pointer |
ObjectArgStorage | Storage for the object argument of a get() call |
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename Object >
Returns the value of the member object of a given object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Returns
- A type-erased reference to the member object in the given object
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename Object >
Returns the value of the member object of a given object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Returns
- A type-erased reference to the member object in the given object Returns a reference to the member object pointer stored by the Field object
The behavior is undefined if the Field object is empty
- Template Parameters
-
T | Member object pointer. The behavior is undefined if is not the type of the member object pointer stored by the Field object |
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename Storage_ >
Returns the value of the member object of a given type-erased object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Returns
- A type-erased reference to the member object in the given type-erased object
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename Storage_ >
Returns the value of the member object of a given type-erased object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Returns
- A type-erased reference to the member object in the given type-erased object
template<typename Storage , typename ObjectArgStorage = Storage>
Returns the value of the member object of a given type-erased object reference.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Returns
- A type-erased reference to the member object in the given type-erased object
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename T , typename Object >
Returns the value of the member object of a given object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Template Parameters
-
T | Type of the member object. The behavior is undefined if this is not the type of the member object |
- Returns
- A reference to the member object in the given object
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename T , typename Object >
Returns the value of the member object of a given object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Template Parameters
-
T | Type of the member object. The behavior is undefined if this is not the type of the member object |
- Returns
- A reference to the member object in the given object
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename T , typename Storage_ >
Returns the value of the member object of a given type erased object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Template Parameters
-
T | Type of the member object. The behavior is undefined if this is not the type of the member object |
- Returns
- A reference to the member object in the given type-erased object
template<typename Storage , typename ObjectArgStorage = Storage>
template<typename T , typename Storage_ >
Returns the value of the member object of a given type erased object.
This function accesses to the member object referenced by the Field object on a given object. The behavior is undefined if the given object is not of the same class the stored member object pointer belongs to. Also, the behavior is undefined if the Field object is empty.
- Template Parameters
-
T | Type of the member object. The behavior is undefined if this is not the type of the member object |
- Returns
- A reference to the member object in the given type-erased object