Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
berry::Status Class Reference

#include <berryStatus.h>

Inheritance diagram for berry::Status:
Collaboration diagram for berry::Status:

Classes

struct  SourceLocation
 

Public Member Functions

 Status (const Severity &severity, const QString &pluginId, int code, const QString &message, const SourceLocation &sl)
 
 Status (const Severity &severity, const QString &pluginId, int code, const QString &message, const ctkException &exc, const SourceLocation &sl)
 
 Status (const Severity &severity, const QString &pluginId, const QString &message, const SourceLocation &sl)
 
 Status (const Severity &severity, const QString &pluginId, const QString &message, const ctkException &exc, const SourceLocation &sl)
 
QList< IStatus::PointerGetChildren () const override
 
int GetCode () const override
 
const ctkException * GetException () const override
 
QString GetMessage () const override
 
QString GetPlugin () const override
 
Severity GetSeverity () const override
 
bool IsMultiStatus () const override
 
bool IsOK () const override
 
bool Matches (const Severities &severityMask) const override
 
QString GetFileName () const override
 
QString GetMethodName () const override
 
int GetLineNumber () const override
 
QString ToString () const override
 
- Public Member Functions inherited from berry::IStatus
 berryObjectMacro (berry::IStatus)
 
- Public Member Functions inherited from berry::Object
virtual QString GetClassName () const
 
virtual Reflection::TypeInfo GetTypeInfo () const
 
virtual QList< Reflection::TypeInfoGetSuperclasses () const
 
virtual void Delete ()
 
QDebug Print (QDebug os, Indent Indent=0) const
 
virtual uint HashCode () const
 
virtual bool operator< (const Object *) const
 
void Register () const
 
void UnRegister (bool del=true) const
 
int GetReferenceCount () const
 
void SetReferenceCount (int)
 
void AddDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
void RemoveDestroyListener (const MessageAbstractDelegate<> &delegate) const
 
virtual bool operator== (const Object *) const
 

Static Public Member Functions

static const IStatus::Pointer OK_STATUS (const SourceLocation &sl)
 
static const IStatus::Pointer CANCEL_STATUS (const SourceLocation &sl)
 
- Static Public Member Functions inherited from berry::Object
static const char * GetStaticClassName ()
 
static Reflection::TypeInfo GetStaticTypeInfo ()
 
static QList< Reflection::TypeInfoGetStaticSuperclasses ()
 

Protected Member Functions

virtual void SetCode (int code)
 
virtual void SetException (const ctkException &exception)
 
virtual void SetMessage (const QString &message)
 
virtual void SetPlugin (const QString &pluginId)
 
virtual void SetSeverity (const Severity &severity)
 
- Protected Member Functions inherited from berry::Object
 Object ()
 
virtual ~Object ()
 
virtual QDebug PrintSelf (QDebug os, Indent indent) const
 
virtual QDebug PrintHeader (QDebug os, Indent indent) const
 
virtual QDebug PrintTrailer (QDebug os, Indent indent) const
 

Additional Inherited Members

- Public Types inherited from berry::IStatus
enum  Severity {
  OK_TYPE, INFO_TYPE, WARNING_TYPE, ERROR_TYPE,
  CANCEL_TYPE
}
 
- Public Types inherited from berry::Object
typedef Object Self
 
typedef berry::SmartPointer< SelfPointer
 
typedef berry::SmartPointer< const SelfConstPointer
 
typedef berry::WeakPointer< SelfWeakPtr
 
typedef berry::WeakPointer< const SelfConstWeakPtr
 
- Protected Attributes inherited from berry::Object
QAtomicInt m_ReferenceCount
 
QMutex m_ReferenceCountLock
 

Detailed Description

A concrete status implementation, suitable either for instantiating or subclassing.

This class can be used without OSGi running.

Definition at line 30 of file berryStatus.h.

Constructor & Destructor Documentation

◆ Status() [1/4]

berry::Status::Status ( const Severity severity,
const QString &  pluginId,
int  code,
const QString &  message,
const SourceLocation sl 
)

Creates a new status object. The created status has no children.

Parameters
severitythe severity; one of OK, ERROR, INFO, WARNING, or CANCEL
pluginIdthe unique identifier of the relevant plug-in
codethe plug-in-specific status code, or OK
messagea human-readable message, localized to the current locale
sl

◆ Status() [2/4]

berry::Status::Status ( const Severity severity,
const QString &  pluginId,
int  code,
const QString &  message,
const ctkException &  exc,
const SourceLocation sl 
)

Creates a new status object. The created status has no children.

Parameters
severitythe severity; one of OK, ERROR, INFO, WARNING, or CANCEL
pluginIdthe unique identifier of the relevant plug-in
codethe plug-in-specific status code, or OK
messagea human-readable message, localized to the current locale
exca low-level exception.
sl

◆ Status() [3/4]

berry::Status::Status ( const Severity severity,
const QString &  pluginId,
const QString &  message,
const SourceLocation sl 
)

Simplified constructor of a new status object; assumes that code is OK. The created status has no children.

Parameters
severitythe severity; one of OK, ERROR, INFO, WARNING, or CANCEL
pluginIdthe unique identifier of the relevant plug-in
messagea human-readable message, localized to the current locale
sl

◆ Status() [4/4]

berry::Status::Status ( const Severity severity,
const QString &  pluginId,
const QString &  message,
const ctkException &  exc,
const SourceLocation sl 
)

Simplified constructor of a new status object; assumes that code is OK. The created status has no children.

Parameters
severitythe severity; one of OK, ERROR, INFO, WARNING, or CANCEL
pluginIdthe unique identifier of the relevant plug-in
messagea human-readable message, localized to the current locale
exca low-level exception.
sl

Member Function Documentation

◆ CANCEL_STATUS()

static const IStatus::Pointer berry::Status::CANCEL_STATUS ( const SourceLocation sl)
static

A standard CANCEL status with no message.

◆ GetChildren()

QList<IStatus::Pointer> berry::Status::GetChildren ( ) const
overridevirtual

Returns a list of status object immediately contained in this multi-status, or an empty list if this is not a multi-status.

Returns
an array of status objects
See also
IsMultiStatus()

Implements berry::IStatus.

◆ GetCode()

int berry::Status::GetCode ( ) const
overridevirtual

Returns the plug-in-specific status code describing the outcome.

Returns
plug-in-specific status code

Implements berry::IStatus.

◆ GetException()

const ctkException* berry::Status::GetException ( ) const
overridevirtual

Returns the relevant low-level exception, or null if none. For example, when an operation fails because of a network communications failure, this might return the java.io.IOException describing the exact nature of that failure.

Returns
the relevant low-level exception, or null if none

Implements berry::IStatus.

◆ GetFileName()

QString berry::Status::GetFileName ( ) const
overridevirtual

Implements berry::IStatus.

◆ GetLineNumber()

int berry::Status::GetLineNumber ( ) const
overridevirtual

Implements berry::IStatus.

◆ GetMessage()

QString berry::Status::GetMessage ( ) const
overridevirtual

Returns the message describing the outcome. The message is localized to the current locale.

Returns
a localized message

Implements berry::IStatus.

◆ GetMethodName()

QString berry::Status::GetMethodName ( ) const
overridevirtual

Implements berry::IStatus.

◆ GetPlugin()

QString berry::Status::GetPlugin ( ) const
overridevirtual

Returns the unique identifier of the plug-in associated with this status (this is the plug-in that defines the meaning of the status code).

Returns
the unique identifier of the relevant plug-in

Implements berry::IStatus.

◆ GetSeverity()

Severity berry::Status::GetSeverity ( ) const
overridevirtual

Returns the severity. The severities are as follows (in descending order):

  • CANCEL_TYPE - cancellation occurred
  • ERROR_TYPE - a serious error (most severe)
  • WARNING_TYPE - a warning (less severe)
  • INFO_TYPE - an informational ("fyi") message (least severe)
  • OK_TYPE - everything is just fine

The severity of a multi-status is defined to be the maximum severity of any of its children, or OK if it has no children.

Returns
the severity: one of OK_TYPE, ERROR_TYPE, INFO_TYPE, WARNING_TYPE, or CANCEL_TYPE

Implements berry::IStatus.

◆ IsMultiStatus()

bool berry::Status::IsMultiStatus ( ) const
overridevirtual

Returns whether this status is a multi-status. A multi-status describes the outcome of an operation involving multiple operands.

The severity of a multi-status is derived from the severities of its children; a multi-status with no children is OK_TYPE by definition. A multi-status carries a plug-in identifier, a status code, a message, and an optional exception. Clients may treat multi-status objects in a multi-status unaware way.

Returns
true for a multi-status, false otherwise
See also
GetChildren()

Implements berry::IStatus.

◆ IsOK()

bool berry::Status::IsOK ( ) const
overridevirtual

Returns whether this status indicates everything is okay (neither info, warning, nor error).

Returns
true if this status has severity OK, and false otherwise

Implements berry::IStatus.

◆ Matches()

bool berry::Status::Matches ( const Severities &  severityMask) const
overridevirtual

Returns whether the severity of this status matches the given severity mask. Note that a status with severity OK_TYPE will never match; use isOK instead to detect a status with a severity of OK.

Parameters
severityMaska mask formed by bitwise or'ing severity mask constants (ERROR_TYPE, WARNING_TYPE, INFO_TYPE, CANCEL_TYPE)
Returns
true if there is at least one match, false if there are no matches
See also
GetSeverity()
CANCEL_TYPE
ERROR_TYPE
WARNING_TYPE
INFO_TYPE

Implements berry::IStatus.

◆ OK_STATUS()

static const IStatus::Pointer berry::Status::OK_STATUS ( const SourceLocation sl)
static

A standard OK status with an "ok" message.

◆ SetCode()

virtual void berry::Status::SetCode ( int  code)
protectedvirtual

Sets the status code.

Parameters
codethe plug-in-specific status code, or OK

◆ SetException()

virtual void berry::Status::SetException ( const ctkException &  exception)
protectedvirtual

Sets the exception.

Parameters
exceptiona low-level exception, or null if not applicable

◆ SetMessage()

virtual void berry::Status::SetMessage ( const QString &  message)
protectedvirtual

Sets the message. If null is passed, message is set to an empty string.

Parameters
messagea human-readable message, localized to the current locale

◆ SetPlugin()

virtual void berry::Status::SetPlugin ( const QString &  pluginId)
protectedvirtual

Sets the plug-in id.

Parameters
pluginIdthe unique identifier of the relevant plug-in

◆ SetSeverity()

virtual void berry::Status::SetSeverity ( const Severity severity)
protectedvirtual

Sets the severity.

Parameters
severitythe severity; one of OK, ERROR, INFO, WARNING, or CANCEL

◆ ToString()

QString berry::Status::ToString ( ) const
overridevirtual

Returns a string representation of the status, suitable for debugging purposes only.

Reimplemented from berry::Object.


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