ug4
ug::bridge::ExportedClass< TClass > Class Template Reference

This template class represents real c++ classes in the registry. More...

#include <class.h>

+ Inheritance diagram for ug::bridge::ExportedClass< TClass >:

Public Member Functions

template<typename T >
ExportedClass< TClass > & add_ (T t)
 
ExportedClass< TClass > & add_constructor ()
 Make default constructor accessible. More...
 
template<typename TFunc >
ExportedClass< TClass > & add_constructor (std::string paramInfos="", std::string tooltip="", std::string help="", std::string options="")
 constructor registration More...
 
template<typename TMethod >
ExportedClass< TClass > & add_method (std::string methodName, TMethod func, std::string retValInfos="", std::string paramInfos="", std::string tooltip="", std::string help="")
 Method registration. More...
 
virtual const ClassNameNodeclass_name_node () const
 name node of class More...
 
virtual const std::vector< const char * > * class_names () const
 class-hierarchy More...
 
 ExportedClass (const std::string &name, const std::string &group, const std::string &tooltip)
 
virtual DeleteFunction get_delete_function () const
 return pointer to the delete method More...
 
virtual const std::string & group () const
 get groups More...
 
virtual bool is_json_constructible () const
 is json constructible More...
 
virtual const std::string & name () const
 name of class More...
 
virtual ~ExportedClass ()
 destructor More...
 
- Public Member Functions inherited from ug::bridge::ExportedClassBaseImpl
virtual bool construct_as_smart_pointer () const
 returns whether the class shall be wrapped in a SmartPtr on construction More...
 
virtual void destroy (void *obj) const
 destructur for object More...
 
 ExportedClassBaseImpl (const std::string &tooltip)
 
virtual const ExportedMethodGroupget_const_exported_method_group (const std::string &name) const
 
virtual const ExportedMethodget_const_method (size_t i) const
 returns the first overload of an exported const function More...
 
virtual const ExportedMethodGroupget_const_method_group (size_t ind) const
 returns the i-th method group (all overloads of the i-th function) More...
 
virtual const ExportedMethodget_const_overload (size_t funcInd, size_t oInd) const
 returns the i-th overload of a const method More...
 
virtual const ExportedConstructorget_constructor (size_t i) const
 get exported constructor More...
 
virtual const ExportedMethodGroupget_exported_method_group (const std::string &name) const
 
virtual const boost::optional< ExportedConstructor & > get_json_constructor () const
 get constructor for construction from json More...
 
virtual const ExportedMethodget_method (size_t i) const
 returns the first overload of an exported function More...
 
virtual const ExportedMethodGroupget_method_group (size_t ind) const
 returns the i-th method group (all overloads of the i-th function) More...
 
virtual const ExportedMethodget_overload (size_t funcInd, size_t oInd) const
 returns the i-th overload of a method More...
 
virtual bool is_instantiable () const
 is instantiable More...
 
virtual size_t num_const_methods () const
 number of registered const-methods (overloads are not counted) More...
 
virtual size_t num_const_overloads (size_t funcInd) const
 returns the number of overloads of a const method More...
 
virtual size_t num_constructors () const
 number of registered constructors More...
 
virtual size_t num_methods () const
 number of registered methods (overloads are not counted) More...
 
virtual size_t num_overloads (size_t funcInd) const
 returns the number of overloads of a method More...
 
virtual void set_construct_as_smart_pointer (bool enable)
 sets whether the class shall be wrapped in a SmartPtr More...
 
virtual const std::string & tooltip () const
 tooltip More...
 
virtual ~ExportedClassBaseImpl ()
 destructor More...
 
- Public Member Functions inherited from ug::bridge::IExportedClass
virtual bool check_consistency () const
 returns false is consistency-check failed More...
 
virtual ~IExportedClass ()
 virtual destructor More...
 

Private Member Functions

 ExportedClass ()
 
 ExportedClass (const ExportedClass &other)
 

Additional Inherited Members

- Public Types inherited from ug::bridge::IExportedClass
typedef void(* DeleteFunction) (const void *)
 
- Protected Types inherited from ug::bridge::ExportedClassBaseImpl
typedef void(* DestructorFunc) (void *)
 
- Protected Member Functions inherited from ug::bridge::ExportedClassBaseImpl
bool constmethodname_registered (const std::string &name)
 returns true if methodname is already used by a method in this class More...
 
bool constructor_type_id_registered (size_t typeID)
 returns if a constructor overload is registered More...
 
ExportedMethodGroupget_const_exported_method_group (const std::string &name)
 
ExportedMethodGroupget_exported_method_group (const std::string &name)
 
bool methodname_registered (const std::string &name)
 returns true if methodname is already used by a method in this class More...
 
- Protected Attributes inherited from ug::bridge::ExportedClassBaseImpl
bool m_constructAsSmartPtr
 
DestructorFunc m_destructor
 
std::string m_tooltip
 
std::vector< ExportedMethodGroup * > m_vConstMethod
 
std::vector< ConstructorOverloadm_vConstructor
 
std::vector< ExportedMethodGroup * > m_vMethod
 

Detailed Description

template<typename TClass>
class ug::bridge::ExportedClass< TClass >

This template class represents real c++ classes in the registry.

Constructor & Destructor Documentation

◆ ExportedClass() [1/3]

template<typename TClass >
ug::bridge::ExportedClass< TClass >::ExportedClass ( )
inlineprivate

◆ ExportedClass() [2/3]

template<typename TClass >
ug::bridge::ExportedClass< TClass >::ExportedClass ( const ExportedClass< TClass > &  other)
private

◆ ExportedClass() [3/3]

template<typename TClass >
ug::bridge::ExportedClass< TClass >::ExportedClass ( const std::string &  name,
const std::string &  group,
const std::string &  tooltip 
)
inline

◆ ~ExportedClass()

template<typename TClass >
virtual ug::bridge::ExportedClass< TClass >::~ExportedClass ( )
inlinevirtual

destructor

Member Function Documentation

◆ add_()

template<typename TClass >
template<typename T >
ExportedClass<TClass>& ug::bridge::ExportedClass< TClass >::add_ ( t)
inline

◆ add_constructor() [1/2]

template<typename TClass >
ExportedClass<TClass>& ug::bridge::ExportedClass< TClass >::add_constructor ( )
inline

Make default constructor accessible.

References ug::bridge::ExportedClassBaseImpl::m_destructor.

◆ add_constructor() [2/2]

template<typename TClass >
template<typename TFunc >
ExportedClass<TClass>& ug::bridge::ExportedClass< TClass >::add_constructor ( std::string  paramInfos = "",
std::string  tooltip = "",
std::string  help = "",
std::string  options = "" 
)
inline

constructor registration

Parameters
paramInfosstring documenting the parameters of the function seperate parameters with an # e.g. "x#y#z" (don't specify the type of the values) (optional)
toolTipsmall documentation for the function (optional)
helphelp string for the function
optionsstyle option of the constructor itself (for visualisation)
See also
ug4-Registry

References ug::bridge::ExportedClassBaseImpl::constructor_type_id_registered(), ug::bridge::ExportedConstructor::create_parameter_stack(), ug::bridge::ExportedClassBaseImpl::m_vConstructor, ug::bridge::ExportedClass< TClass >::name(), ug::bridge::ExportedClassBaseImpl::tooltip(), and UG_THROW_REGISTRY_ERROR.

◆ add_method()

template<typename TClass >
template<typename TMethod >
ExportedClass<TClass>& ug::bridge::ExportedClass< TClass >::add_method ( std::string  methodName,
TMethod  func,
std::string  retValInfos = "",
std::string  paramInfos = "",
std::string  tooltip = "",
std::string  help = "" 
)
inline

Method registration.

Parameters
methodNamethe name of the method to appear in the registry
funcpointer to the member function (e.g. &MyClass::my_method)
retValInfosstring documenting what the function returns (optional)
paramInfosstring documenting the parameters of the function seperate parameters with an # e.g. "x#y#z" (don't specify the type of the values) (optional)
toolTipsmall documentation for the function (optional)
helphelp string for the function
See also
ug4-Registry
How to specify additional information

References ug::bridge::ExportedMethodGroup::add_overload(), func(), ug::bridge::ExportedClassBaseImpl::get_const_exported_method_group(), ug::bridge::ExportedClassBaseImpl::get_exported_method_group(), ug::GetRegistryIdentifierMessage(), ug::IsValidRegistryIdentifier(), ug::bridge::ExportedClassBaseImpl::m_vConstMethod, ug::bridge::ExportedClassBaseImpl::m_vMethod, ug::bridge::ExportedClass< TClass >::name(), ug::bridge::ExportedClassBaseImpl::tooltip(), ug::TrimString(), and UG_THROW_REGISTRY_ERROR.

◆ class_name_node()

template<typename TClass >
virtual const ClassNameNode& ug::bridge::ExportedClass< TClass >::class_name_node ( ) const
inlinevirtual

◆ class_names()

template<typename TClass >
virtual const std::vector<const char*>* ug::bridge::ExportedClass< TClass >::class_names ( ) const
inlinevirtual

◆ get_delete_function()

template<typename TClass >
virtual DeleteFunction ug::bridge::ExportedClass< TClass >::get_delete_function ( ) const
inlinevirtual

return pointer to the delete method

Implements ug::bridge::IExportedClass.

◆ group()

template<typename TClass >
virtual const std::string& ug::bridge::ExportedClass< TClass >::group ( ) const
inlinevirtual

◆ is_json_constructible()

template<typename TClass >
virtual bool ug::bridge::ExportedClass< TClass >::is_json_constructible ( ) const
inlinevirtual

is json constructible

Implements ug::bridge::IExportedClass.

◆ name()


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