Medical Imaging Interaction Toolkit
2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
|
#include <berryParameterType.h>
Public Member Functions | |
berryObjectMacro (ParameterType) | |
void | AddListener (IParameterTypeListener *listener) |
bool | operator< (const Object *object) const override |
void | Define (const QString &type, const QSharedPointer< IParameterValueConverter > ¶meterTypeConverter) |
IParameterValueConverter * | GetValueConverter () const |
bool | IsCompatible (const QObject *const value) const |
void | RemoveListener (IParameterTypeListener *listener) |
QString | ToString () const override |
void | Undefine () override |
Public Member Functions inherited from berry::HandleObject | |
berryObjectMacro (HandleObject) | |
bool | operator== (const Object *object) const override |
QString | GetId () const |
uint | HashCode () const override |
bool | IsDefined () const |
Public Member Functions inherited from berry::Object | |
virtual QString | GetClassName () const |
virtual Reflection::TypeInfo | GetTypeInfo () const |
virtual QList< Reflection::TypeInfo > | GetSuperclasses () const |
virtual void | Delete () |
QDebug | Print (QDebug os, Indent Indent=0) 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 |
Protected Member Functions | |
ParameterType (const QString &id) | |
Protected Member Functions inherited from berry::HandleObject | |
HandleObject (const QString &id) | |
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::Object | |
typedef Object | Self |
typedef berry::SmartPointer< Self > | Pointer |
typedef berry::SmartPointer< const Self > | ConstPointer |
typedef berry::WeakPointer< Self > | WeakPtr |
typedef berry::WeakPointer< const Self > | ConstWeakPtr |
Static Public Member Functions inherited from berry::Object | |
static const char * | GetStaticClassName () |
static Reflection::TypeInfo | GetStaticTypeInfo () |
static QList< Reflection::TypeInfo > | GetStaticSuperclasses () |
Protected Attributes inherited from berry::HandleObject | |
bool | defined |
const QString | id |
QString | str |
Protected Attributes inherited from berry::Object | |
QAtomicInt | m_ReferenceCount |
QMutex | m_ReferenceCountLock |
Provides information about the type of a command parameter. Clients can use a parameter type to check if an object matches the type of the parameter with IsCompatible(Object::Pointer)
and can get an IParameterValueConverter to convert between objects matching the parameter type and strings that encode the object's identity.
A command parameter is not required to declare a type. To determine if a given parameter has a type, check if an IParameter implements ITypedParameter and if so, use ITypedParameter#GetParameterType() like this:
IParameter::Pointer parameter = // ... get IParameter from Command if (ITypedParameter::Pointer typedParameter = parameter.Cast<ITypedParameter>()) { ParameterType::Pointer type = typedParameter->GetParameterType(); if (type) { // this parameter has a ParameterType } }
Definition at line 56 of file berryParameterType.h.
|
protected |
Constructs a new instance based on the given identifier. When a parameter type is first constructed, it is undefined. Parameter types should only be constructed by the CommandManager to ensure that the identifier remains unique.
id | The identifier for this type. This value must not be null , and must be unique amongst all parameter types. |
void berry::ParameterType::AddListener | ( | IParameterTypeListener * | listener | ) |
Adds a listener to this parameter type that will be notified when its state changes.
listener | The listener to be added; must not be null . |
berry::ParameterType::berryObjectMacro | ( | ParameterType | ) |
void berry::ParameterType::Define | ( | const QString & | type, |
const QSharedPointer< IParameterValueConverter > & | parameterTypeConverter | ||
) |
Defines this parameter type, setting the defined property to true
.
Notification is sent to all listeners that something has changed.
type | a string identifying the object type for this parameter type; null is interpreted as "QObject" |
parameterTypeConverter | an AbstractParameterValueConverter to perform string/object conversions for parameter values; may be null |
IParameterValueConverter* berry::ParameterType::GetValueConverter | ( | ) | const |
Returns the value converter associated with this parameter, if any.
null
if there is no value converter for this parameter. NotDefinedException | if the parameter type is not currently defined |
bool berry::ParameterType::IsCompatible | ( | const QObject *const | value | ) | const |
Returns whether the provided value is compatible with this parameter type. An object is compatible with a parameter type if the object is an instance of the class defined as the parameter's type class.
value | an object to check for compatibility with this parameter type; may be null . |
true
if the value is compatible with this type, false
otherwise NotDefinedException | if the parameter type is not currently defined |
|
overridevirtual |
Compares this parameter type with another object by comparing each of the non-transient attributes.
object | The object with which to compare; must be an instance of ParameterType. |
Reimplemented from berry::Object.
void berry::ParameterType::RemoveListener | ( | IParameterTypeListener * | listener | ) |
Unregisters listener for changes to properties of this parameter type.
listener | the instance to unregister. Must not be null . If an attempt is made to unregister an instance which is not already registered with this instance, no operation is performed. |
|
overridevirtual |
The string representation of this parameter type. For debugging purposes only. This string should not be shown to an end user.
null
. Reimplemented from berry::Object.
|
overridevirtual |
Makes this parameter type become undefined. Notification is sent to all listeners.
Implements berry::HandleObject.