Envision
A visual programming IDE for object-oriented languages
List of all members | Public Types | Static Public Member Functions | Private Types | Static Private Member Functions
Core::AdapterManager Class Reference

Public Types

using AdapterCreationFunction = void *(*)(void *adaptee)
 

Static Public Member Functions

template<typename Adapter , typename Adaptee >
static Adapter * adapt (Adaptee *object)
 
template<typename AdapterBase , typename Adapter , typename Adaptee >
static AdapterBase * createFrom (Adaptee *a)
 Creates an instance of Adapter using it's Adapter::Adapter(Adaptee* a) constructor. More...
 
template<typename Adapter , typename Adaptee >
static void registerAdapter (Adapter *(*creationFunction)(Adaptee *adaptee))
 
template<typename AdapterBase , typename Adapter , typename Adaptee >
static void registerAdapterViaConstructor ()
 
template<typename Adapter >
static void registerDefaultAdapter (Adapter *(*creationFunction)(typename Adapter::BaseAdapteeType *adaptee))
 

Private Types

using AdapterKey = QPair< TypeIdType, TypeIdType >
 
using TypeIdType = std::size_t
 

Static Private Member Functions

static QHash< AdapterKey, AdapterCreationFunction > & adapters ()
 
static QHash< TypeIdType, AdapterCreationFunction > & defaultAdapters ()
 
template<typename type >
static TypeIdType typeId ()
 
template<typename type >
static TypeIdType typeId (type *object)
 

Member Typedef Documentation

◆ AdapterCreationFunction

using Core::AdapterManager::AdapterCreationFunction = void* (*)(void* adaptee)

◆ AdapterKey

◆ TypeIdType

using Core::AdapterManager::TypeIdType = std::size_t
private

Member Function Documentation

◆ adapt()

template<typename Adapter , typename Adaptee >
Adapter * Core::AdapterManager::adapt ( Adaptee *  object)
static

◆ adapters()

QHash< AdapterManager::AdapterKey, AdapterManager::AdapterCreationFunction > & Core::AdapterManager::adapters ( )
staticprivate

◆ createFrom()

template<typename AdapterBase , typename Adapter , typename Adaptee >
AdapterBase * Core::AdapterManager::createFrom ( Adaptee *  a)
static

Creates an instance of Adapter using it's Adapter::Adapter(Adaptee* a) constructor.

This is a convenience method for creating adapter functions.

◆ defaultAdapters()

QHash< AdapterManager::TypeIdType, AdapterManager::AdapterCreationFunction > & Core::AdapterManager::defaultAdapters ( )
staticprivate

◆ registerAdapter()

template<typename Adapter , typename Adaptee >
void Core::AdapterManager::registerAdapter ( Adapter *(*)(Adaptee *adaptee)  creationFunction)
static

◆ registerAdapterViaConstructor()

template<typename AdapterBase , typename Adapter , typename Adaptee >
void Core::AdapterManager::registerAdapterViaConstructor
static

◆ registerDefaultAdapter()

template<typename Adapter >
void Core::AdapterManager::registerDefaultAdapter ( Adapter *(*)(typename Adapter::BaseAdapteeType *adaptee)  creationFunction)
static

◆ typeId() [1/2]

template<typename type >
AdapterManager::TypeIdType Core::AdapterManager::typeId
staticprivate

◆ typeId() [2/2]

template<typename type >
AdapterManager::TypeIdType Core::AdapterManager::typeId ( type *  object)
staticprivate