Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Slots | Signals | Public Member Functions | Static Public Attributes | List of all members
Ilwis::Kernel Class Reference

#include <kernel.h>

Inheritance diagram for Ilwis::Kernel:

Public Slots

void doProgress (quint64 id, qint32 amount)
 

Signals

void doCommand (const QString &expr, ExecutionContext *ctx)
 

Public Member Functions

 Kernel (QObject *parent=0)
 
void setTLS (const QString &key, QVariant *data)
 
void deleteTLS (const QString &key)
 
const QVariant * getFromTLS (const QString &key) const
 
void addFactory (FactoryInterface *fac)
 
QString translate (const QString &s) const
 
const SPVersion & version () const
 
void init ()
 
PublicDatabasedatabase ()
 
QScopedPointer< IssueLogger > & issues ()
 
QString demangle (const char *mangled_name)
 
bool message (const QString &message, IssueObject::IssueType, const QString p1, const QString p2, const QString p3, const QString &file, int line, const QString &func)
 
template<class T >
const T * factory (const QString &type, const QString &subtype="") const
 
template<class T >
T * factory (const QString &type, const QString &subtype="")
 
template<class T >
const T * factory (const QString &kind, const Resource &resource) const
 
void startClock ()
 
void endClock (const QString &label="")
 
SPTranquilizer createTrq (const QString &title, const QString &description, qint64 end, qint32 step)
 

Static Public Attributes

static Kernel_kernel = 0
 

Detailed Description

The Kernel class a singleton object that controls some essential resources in the system.

Constructor & Destructor Documentation

Kernel::Kernel ( QObject *  parent = 0)
explicit

Constructor. The kernel is constructed when the kernel() method, a global method , is called.

Parameters
parent

Member Function Documentation

void Kernel::addFactory ( FactoryInterface fac)

Adds a factory to the masterfactory. The masterfactory holds all the factories in the system but it is not visible to the outside world.

Parameters
facthe factory to be added
PublicDatabase & Kernel::database ( )

Returns a reference to the publicdatabase

Returns
void Kernel::deleteTLS ( const QString &  key)

deleteTLS deletes the memory of the thread local variable

Parameters
keyname of the variable to be deleted
QString Kernel::demangle ( const char *  mangled_name)

Adds an operation to the commandhandler. The commandhandler is the internal object that handles commands but it is not visible to the outside clients

Parameters
infothe structure containing the information about the new command
template<class T >
const T* Ilwis::Kernel::factory ( const QString &  type,
const QString &  subtype = "" 
) const
inline

Returns a const reference to a factory of a certain combination of type and subtype.

Parameters
typemain typename of the factory. e.g. IlwisObjectFactory or CatalogFactory
subtypeoptional further specialization of the factory type. usualy for factories that are contained in a module were the subtype identifies the module the. It is flexible though and could also be used in other combinations
template<class T >
T* Ilwis::Kernel::factory ( const QString &  type,
const QString &  subtype = "" 
)
inline

Returns a to a factory of a certain combination of type and subtype

Parameters
typemain typename of the factory. e.g. IlwisObjectFactory or CatalogFactory
subtypeoptional further specialization of the factory type. usualy for factories that are contained in a module were the subtype identifies the module the. It is flexible though and could also be used in other combinations
Returns
an instanciated factory or 0. In the case of 0 the issuelogger will log the error
template<class T >
const T* Ilwis::Kernel::factory ( const QString &  kind,
const Resource resource 
) const
inline

Returns a facotry for a certain kind of objects and resource. The method tries to find a factory of a certain kind that can handle that type of resource. It will query the known factories through the canUse method if it can handle the resource. If so it will return the factory

Returns
an instanciated factory or 0. In the case of 0 the issuelogger will log the error
const QVariant * Kernel::getFromTLS ( const QString &  key) const

Returns the (pointer to) data of a thread local variable. The method will return a const reference because the client using this method may never delete this pointer. It is controlled by the TLS

Parameters
keyname of the variable
Returns
const reference to the variable.
void Kernel::init ( )

Initializes the resources maintained by the kernel

QScopedPointer< IssueLogger > & Kernel::issues ( )

issues returns a reference to the issuelogger. In the software the issuelogger is used to store all kinds of info about what is happening. This method exposes the logger to add/retrieve information.

Returns
issuelogger
bool Kernel::message ( const QString &  message,
IssueObject::IssueType  tp,
const QString  p1,
const QString  p2,
const QString  p3,
const QString &  file,
int  line,
const QString &  func 
)

Convenience method that shortens the code to put errors in the issuelogger. The method is mainly used by the ERROR macros to pass messages to the logger

Parameters
messagethe actual error message
p1(optional) error specific fill value
p2(optional) error specific fill value
Returns
always return false. means the macros can be used directly in the return statement of the place were the error occurred. At these places usually a false is returned
void Kernel::setTLS ( const QString &  key,
QVariant *  data 
)

Stores a thread local variable under a certain key in the thread storage

Parameters
keyname of the variable that is stored
datapointer to the data to be stored
QString Kernel::translate ( const QString &  s) const

Translates a string to local language. The default language is english and this will have a null translation

Parameters
s
Returns
const SPVersion & Kernel::version ( ) const

Returns the version object of this ilwis instance. The version object contains all info about versioning of the kernel and its modules

Returns
const pointer to the version object. The object can not be changed by clients of the kernel

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