• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • TDevelop Interfaces Library
 

TDevelop Interfaces Library

Public Member Functions | List of all members
KDevGenericFactory< T, ParentType > Class Template Reference

#include <kdevgenericfactory.h>

Inherits KGenericFactory< T, ParentType >.

Public Member Functions

 KDevGenericFactory (TDEAboutData *data)
 
TDEInstance * createInstance ()
 

Detailed Description

template<class T, class ParentType = TQObject>
class KDevGenericFactory< T, ParentType >

This class provides a generic implementation of a KLibFactory for use with TDevelop plugins.

Usually it is convenient to use K_EXPORT_COMPONENT_FACTORY macro to create factories for TDevelop plugins. For example, for DummyPlugin the factory can be created (in dummyplugin.cpp file) as:

typedef KDevGenericFactory<DummyPlugin> DummyPluginFactory;
K_EXPORT_COMPONENT_FACTORY(libkdevdummyplugin, DummyPluginFactory( data ) )

Data should be a const static object. This way it complies with the requirements for data objecs of KDevGenericFactory constructor.

Important:
There is no need to create TDEAboutData objects. It is more useful to create a static const KDevPluginInfo object which can be used also in the constructor of a plugin.

For example, dummyplugin.cpp file could contain:

#include <kdevplugininfo.h>
static const KDevPluginInfo data("KDevDummyPlugin");
typedef KDevGenericFactory<DummyPlugin> DummyPluginFactory;
K_EXPORT_COMPONENT_FACTORY(libkdevdummyplugin, DummyPluginFactory( data ) )
DummyPlugin::DummyPlugin(TQObject *parent, const char *name, const TQStringList & )
:KDevPlugin(&data, parent, name)
{
}

In the example above the duplication of information is avoided as same KDevPluginInfo objects are used for plugin and for plugin factory. This is possible because KDevPluginInfo class has an operator to cast KDevPluginInfo to TDEAboutData.

Definition at line 65 of file kdevgenericfactory.h.

Constructor & Destructor Documentation

◆ KDevGenericFactory()

template<class T , class ParentType = TQObject>
KDevGenericFactory< T, ParentType >::KDevGenericFactory ( TDEAboutData *  data)
inline

Constructor.

Parameters
dataA reference to TDEAboutData with an information about the plugin. Data should have:
  • plugin name as an application name;
  • untranslated plugin generic name as a product name;
  • license type number.
data object should live as long as factory lives.

Definition at line 76 of file kdevgenericfactory.h.

Member Function Documentation

◆ createInstance()

template<class T , class ParentType = TQObject>
TDEInstance* KDevGenericFactory< T, ParentType >::createInstance ( )
inline

Creates an instance.

Definition at line 82 of file kdevgenericfactory.h.


The documentation for this class was generated from the following file:
  • kdevgenericfactory.h

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

TDevelop Interfaces Library

Skip menu "TDevelop Interfaces Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for TDevelop Interfaces Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.