Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <kernel.h>
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 () |
PublicDatabase & | database () |
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 |
The Kernel class a singleton object that controls some essential resources in the system.
|
explicit |
Constructor. The kernel is constructed when the kernel() method, a global method , is called.
parent |
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.
fac | the factory to be added |
PublicDatabase & Kernel::database | ( | ) |
Returns a reference to the publicdatabase
void Kernel::deleteTLS | ( | const QString & | key | ) |
deleteTLS deletes the memory of the thread local variable
key | name 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
info | the structure containing the information about the new command |
|
inline |
Returns a const reference to a factory of a certain combination of type and subtype.
type | main typename of the factory. e.g. IlwisObjectFactory or CatalogFactory |
subtype | optional 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 |
|
inline |
Returns a to a factory of a certain combination of type and subtype
type | main typename of the factory. e.g. IlwisObjectFactory or CatalogFactory |
subtype | optional 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 |
|
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
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
key | name of 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.
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
message | the actual error message |
p1 | (optional) error specific fill value |
p2 | (optional) error specific fill value |
void Kernel::setTLS | ( | const QString & | key, |
QVariant * | data | ||
) |
Stores a thread local variable under a certain key in the thread storage
key | name of the variable that is stored |
data | pointer 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
s |
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