CanvasCV: canvascv::WidgetFactoryT< T > Class Template Reference
CanvasCV  1.0.0
canvascv::WidgetFactoryT< T > Class Template Reference

The WidgetFactoryT class. More...

#include <widgetfactory.h>

Inheritance diagram for canvascv::WidgetFactoryT< T >:
canvascv::WidgetFactory

Static Public Member Functions

static bool addType (std::string name)
 addType adds type 'T' under name 'name' More...
 
static std::shared_ptr< T > newWidget (Layout &layoutVal, const cv::Point &pos=cv::Point(0, 0))
 newWidget More...
 
- Static Public Member Functions inherited from canvascv::WidgetFactory
static std::shared_ptr< WidgetnewWidget (std::string type, Layout &layoutVal, const cv::Point &pos)
 newWidget More...
 

Detailed Description

template<class T>
class canvascv::WidgetFactoryT< T >

This is the compile-time type-safe version of the WidgetFactory. Types added here with addType() are guranteed to exist at compile time. Types created by newWidget() are guranteed to exist at compile time.

Examples:
example_add_widget.cpp.

Member Function Documentation

template<class T >
bool canvascv::WidgetFactoryT< T >::addType ( std::string  name)
static
Parameters
name
Returns
true if type 'T' is registering for the first time ot false otherwise
See also
CCV_REGISTER_WIDGET macro in WidgetFactory.h
template<class T >
std::shared_ptr< T > canvascv::WidgetFactoryT< T >::newWidget ( Layout layoutVal,
const cv::Point &  pos = cv::Point(0,0) 
)
static

Use this to create widgets by compile-time type.

Parameters
layoutValis the parent layout
posis an intial location for the Widget on the Layout (if the layout supports specific positions).
Returns
a pointer to a newly allocated widget of type 'type'.

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