Lumiera  0.pre.03
»edit your freedom«
InstanceHandle< I, FA > Class Template Reference

#include "common/instancehandle.hpp"

Description

template<class I, class FA = I>
class lumiera::InstanceHandle< I, FA >

Handle tracking the registration of an interface, deregistering it on deletion.

Depending on which flavour of the ctor is used, either (bulk) registration of interfaces or plugin loading is triggered. The interface type is defined by type parameter. Additionally, choosing a facade interface as second type parameter causes installation of a proxy, which implements the facade by routing calls through the basic interface represented by this handle. This proxy will be "closed" automatically when this InstanceHandle goes out of scope. Of course, the proxy needs to be implemented somewhere, typically in interfaceproxy.cpp

Definition at line 54 of file instancehandle.hpp.

Public Member Functions

 InstanceHandle (string const &iName, uint version, size_t minminor, string const &impName)
 Set up an InstanceHandle representing a plugin. More...
 
 InstanceHandle (LumieraInterface descriptor)
 Set up an InstanceHandle managing the registration and deregistration of interface(s). More...
 
I & get () const
 directly access the instance via the CL interface
 
 operator bool () const
 
bool operator! () const
 
FA * operator-> () const
 act as smart pointer to allow access through the facade. More...
 

Private Member Functions

bool isValid () const
 
- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Private Attributes

LumieraInterface desc_
 
facade::Link< I, FA > facadeLink_
 
I * instance_
 

Constructor & Destructor Documentation

◆ InstanceHandle() [1/2]

InstanceHandle ( string const &  iName,
uint  version,
size_t  minminor,
string const &  impName 
)
inline

Set up an InstanceHandle representing a plugin.

Should be placed at the client side.

Parameters
iNameunmangled name of the interface
versionmajor version
minminorminimum acceptable minor version number
impNameunmangled name of the instance (implementation)

Definition at line 198 of file instancehandle.hpp.

◆ InstanceHandle() [2/2]

InstanceHandle ( LumieraInterface  descriptor)
inline

Set up an InstanceHandle managing the registration and deregistration of interface(s).

Should be placed at the service providing side.

Parameters
a(single) interface descriptor, which can be created with LUMIERA_INTERFACE_INSTANCE and referred to by LUMIERA_INTERFACE_REF

Definition at line 213 of file instancehandle.hpp.

Member Function Documentation

◆ operator->()

FA* operator-> ( ) const
inline

act as smart pointer to allow access through the facade.

Note
we don't provide operator*

Definition at line 234 of file instancehandle.hpp.

+ Inheritance diagram for InstanceHandle< I, FA >:
+ Collaboration diagram for InstanceHandle< I, FA >:

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