Mirror reflection library - Lagoon run-time layer 0.5.13
|
The smart pointer-like wrapper for MetaObject(s) More...
#include <lagoon/utils.hpp>
Public Member Functions | |
shared (MetaObject *p) | |
template<class OtherMO > | |
shared (const shared< OtherMO > &other) | |
operator bool (void) const | |
bool | operator! (void) const |
MetaObject * | operator-> (void) const |
template<class Interface > | |
shared< Interface > | as (void) const |
MetaObject interface cast function. | |
template<class Interface > | |
bool | is (void) const |
MetaObject interface capability query function. | |
Friends | |
MetaObject * | aux::_get_mo (const shared< MetaObject > &) |
The smart pointer-like wrapper for MetaObject(s)
This wrapper should be used instead or raw pointers, when dealing with instances of various meta-object types. The meta-object wrapped by this class is managed by the library and NEVER should be deleted manually.
lagoon/example/fold_01.cpp, lagoon/example/for_each_01.cpp, lagoon/example/for_each_02.cpp, lagoon/example/for_each_03.cpp, lagoon/example/for_each_04.cpp, lagoon/example/for_each_05.cpp, lagoon/example/for_each_06.cpp, lagoon/example/for_each_07.cpp, lagoon/example/for_each_08.cpp, lagoon/example/for_each_09.cpp, lagoon/example/for_each_10.cpp, lagoon/example/for_each_11.cpp, lagoon/example/for_each_12.cpp, lagoon/example/std_range_01.cpp, lagoon/example/std_range_02.cpp, lagoon/example/std_range_03.cpp, lagoon/example/std_range_04.cpp, and lagoon/example/various_02.cpp.
shared<Interface> lagoon::shared< MetaObject >::as | ( | void | ) | const [inline] |
MetaObject interface cast function.
This function tries to query the MetaObject
wrapped by this shared
for the requested Interface
and returns a shared wrapper with this interface. If the MetaObject
wrapped by this shared
does not implement the requested interface the returned wrapper is nil.
Referenced by lagoon::meta_namespace::class_().
bool lagoon::shared< MetaObject >::is | ( | void | ) | const [inline] |
MetaObject interface capability query function.
This member function checks if the MetaObject
wrapper by this shared
wrapper implements the requested Interface