PicoScenes API Docs
Loading...
Searching...
No Matches
FrontEndFactory.hxx
Go to the documentation of this file.
1
//
2
// Created by Zhiping Jiang on 12/31/19.
3
//
4
5
#ifndef PICOSCENES_PLATFORM_FRONTENDFACTORY_HXX
6
#define PICOSCENES_PLATFORM_FRONTENDFACTORY_HXX
7
8
#include "
AbstractFrontEnd.hxx
"
9
23
class
FrontEndFactory
{
24
public
:
32
static
std::shared_ptr<AbstractFrontEnd>
getFrontEndInstance
(
const
std::string &referredInterfaceName);
33
42
template<typename FrontEndT, class = typename std::enable_if<std::is_base_of<AbstractFrontEnd, FrontEndT>::value
>::type>
43
static
std::shared_ptr<FrontEndT>
getTypedFrontEndInstance
(
const
std::string &referredInterfaceName) {
44
auto
baseFrontEnd
=
getFrontEndInstance
(referredInterfaceName);
45
auto
typedFrontEnd
= std::dynamic_pointer_cast<FrontEndT>(
baseFrontEnd
);
46
return
typedFrontEnd
;
47
}
48
49
private
:
54
FrontEndFactory
() =
default
;
55
};
56
57
58
#endif
//PICOSCENES_PLATFORM_FRONTENDFACTORY_HXX
AbstractFrontEnd.hxx
FrontEndFactory
Factory class for creating and managing front-end instances.
Definition
FrontEndFactory.hxx:23
FrontEndFactory::getTypedFrontEndInstance
static std::shared_ptr< FrontEndT > getTypedFrontEndInstance(const std::string &referredInterfaceName)
Get a typed front-end instance for the specified interface.
Definition
FrontEndFactory.hxx:43
FrontEndFactory::getFrontEndInstance
static std::shared_ptr< AbstractFrontEnd > getFrontEndInstance(const std::string &referredInterfaceName)
Get a front-end instance for the specified interface.
headers
FrontEndFactory.hxx
Generated by
1.9.8