VISH
0.2
|
Interface cast: Given an Intercube, retrive the an interface object which is stored there. More...
#include </home/werner/origo/vish/memcore/Interface.hpp>
Interface cast: Given an Intercube, retrive the an interface object which is stored there.
Example:
struct myInterface : Interface<int> { int i; }; int InterfaceExample() { Intercube Alpha; Alpha.addInterface( new myInterface() ); RefPtr<myInterface> m = Alpha.getInterface( typeid(int) ); RefPtr<myInterface> n = interface_cast<myInterface>( Alpha ); return 0; }
typedef InterfaceType::InterfaceDomain_t MemCore::interface_cast::InterfaceDomain_t |
The domain type, i.e.
a possible base class of the given interface type, which is used to look up a certain interface. The returned interface may be an implementation of the InterfaceDomain_t.
InterfaceType& MemCore::interface_cast::operator() | ( | ) | const [inline] |
Provide an interface object for the requested type, returning an existing one or creating a new one.
struct X : Interface<X> {};
Intercube I;
X&z = interface_case<X>(I)();
InterfaceType& MemCore::interface_cast::operator() | ( | const InitType & | initValue | ) | const [inline] |
Provide an interface object for the requested type, returning an existing one or creating a new one with the given parameter as constructor argument.
struct X : Interface<X> { X(int) {} }; Intercube I; RefPtr<X> z = interface_case<X>(I)(42);