Mirror reflection library - Lagoon run-time layer 0.5.13

lagoon::shared< MetaObject > Class Template Reference

The smart pointer-like wrapper for MetaObject(s) More...

#include <lagoon/utils.hpp>

Collaboration diagram for lagoon::shared< MetaObject >:

List of all members.

Public Member Functions

 shared (MetaObject *p)
template<class OtherMO >
 shared (const shared< OtherMO > &other)
 operator bool (void) const
bool operator! (void) const
MetaObjectoperator-> (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

MetaObjectaux::_get_mo (const shared< MetaObject > &)

Detailed Description

template<typename MetaObject>
class lagoon::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.

Examples:

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.


Member Function Documentation

template<typename MetaObject>
template<class Interface >
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_().

template<typename MetaObject>
template<class Interface >
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


The documentation for this class was generated from the following file:

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.