CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Member Functions | Static Public Attributes | List of all members
ctkDebugOptions Struct Referenceabstract

#include <Libs/PluginFramework/service/debug/ctkDebugOptions.h>

Public Member Functions

virtual bool getBooleanOption (const QString &option, bool defaultValue) const =0
 
virtual int getIntegerOption (const QString &option, int defaultValue) const =0
 
virtual QVariant getOption (const QString &option) const =0
 
virtual QVariant getOption (const QString &option, const QVariant &defaultValue) const =0
 
virtual QHash< QString, QVariant > getOptions () const =0
 
virtual bool isDebugEnabled () const =0
 
virtual void removeOption (const QString &option)=0
 
virtual void setDebugEnabled (bool enabled)=0
 
virtual void setOption (const QString &option, const QVariant &value)=0
 
virtual void setOptions (const QHash< QString, QVariant > &ops)=0
 
virtual ~ctkDebugOptions ()
 

Static Public Attributes

static const QString LISTENER_SYMBOLICNAME
 

Detailed Description

Used to get debug options settings.

Definition at line 34 of file ctkDebugOptions.h.

Constructor & Destructor Documentation

◆ ~ctkDebugOptions()

virtual ctkDebugOptions::~ctkDebugOptions ( )
inlinevirtual

Definition at line 37 of file ctkDebugOptions.h.

Member Function Documentation

◆ getBooleanOption()

virtual bool ctkDebugOptions::getBooleanOption ( const QString &  option,
bool  defaultValue 
) const
pure virtual

Returns the identified option as a boolean value. The specified defaultValue is returned if no such option is found or if debug is not enabled.

Options are specified in the general form <Plugin-SymbolicName>/<option-path>. For example, org.commontk.configadmin/debug

Parameters
optionthe name of the option to lookup
defaultValuethe value to return if no such option is found
Returns
the value of the requested debug option or the defaultValue if no such option is found.

◆ getIntegerOption()

virtual int ctkDebugOptions::getIntegerOption ( const QString &  option,
int  defaultValue 
) const
pure virtual

Returns the identified option as an int value. The specified defaultValue is returned if no such option is found or if an error occurs while converting the option value to an integer or if debug is not enabled.

Options are specified in the general form <Plugin-SymbolicName>/<option-path>. For example, org.commontk.configadmin/debug

Parameters
optionthe name of the option to lookup
defaultValuethe value to return if no such option is found
Returns
the value of the requested debug option or the defaultValue if no such option is found.

◆ getOption() [1/2]

virtual QVariant ctkDebugOptions::getOption ( const QString &  option) const
pure virtual

Returns the identified option. A null value is returned if no such option is found or if debug is not enabled.

Options are specified in the general form <Plugin-SymbolicName>/<option-path>. For example, org.commontk.configadmin/debug

Parameters
optionthe name of the option to lookup
Returns
the value of the requested debug option or null

◆ getOption() [2/2]

virtual QVariant ctkDebugOptions::getOption ( const QString &  option,
const QVariant &  defaultValue 
) const
pure virtual

Returns the identified option. The specified defaultValue is returned if no such option is found or if debug is not enabled.

Options are specified in the general form <Plugin-SymbolicName>/<option-path>. For example, org.commontk.configadmin/debug

Parameters
optionthe name of the option to lookup
defaultValuethe value to return if no such option is found
Returns
the value of the requested debug option or the defaultValue if no such option is found.

◆ getOptions()

virtual QHash<QString, QVariant> ctkDebugOptions::getOptions ( ) const
pure virtual

Returns a snapshot of the current options. If no options are set then an empty map is returned.

If debug is not enabled then the snapshot of the current disabled values is returned. See setDebugEnabled(bool).

Returns
a snapshot of the current options.

◆ isDebugEnabled()

virtual bool ctkDebugOptions::isDebugEnabled ( ) const
pure virtual

Returns true if debugging/tracing is currently enabled.

Returns
true if debugging/tracing is currently enabled; Otherwise false is returned.

◆ removeOption()

virtual void ctkDebugOptions::removeOption ( const QString &  option)
pure virtual

Removes the identified option. If debug is not enabled then the specified option is not removed.

Parameters
optionthe name of the option to remove

◆ setDebugEnabled()

virtual void ctkDebugOptions::setDebugEnabled ( bool  enabled)
pure virtual

Enables or disables debugging/tracing.

When debug is disabled all debug options are unset. When disabling debug the current debug option values are stored in memory as disabled values. If debug is re-enabled the disabled values will be set back and enabled. The disabled values are only stored in memory and if the framework is restarted then the disabled option values will be lost.

Parameters
valueIf true, debug is enabled, otherwise debug is disabled.

◆ setOption()

virtual void ctkDebugOptions::setOption ( const QString &  option,
const QVariant &  value 
)
pure virtual

Sets the identified option to the identified value. If debug is not enabled then the specified option is not changed.

Parameters
optionthe name of the option to set
valuethe value of the option to set

◆ setOptions()

virtual void ctkDebugOptions::setOptions ( const QHash< QString, QVariant > &  ops)
pure virtual

Sets the current option key/value pairs to the specified options. The specified map replaces all keys and values of the current debug options.

If debug is not enabled then the specified options are saved as the disabled values and no notifications will be sent. See setDebugEnabled(bool). If debug is enabled then notifications will be sent to the listeners which have options that have been changed, added or removed.

Parameters
optionsthe new set of options

Member Data Documentation

◆ LISTENER_SYMBOLICNAME

const QString ctkDebugOptions::LISTENER_SYMBOLICNAME
static

The service property (named "listener.symbolic.name") which specifies the bundle symbolic name of a DebugOptionsListener service.

Definition at line 43 of file ctkDebugOptions.h.


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