PCL
pcl::MetaEnumeration Class Referenceabstract

A formal description of an enumerated process parameter. More...

#include <MetaParameter.h>

+ Inheritance diagram for pcl::MetaEnumeration:

Public Member Functions

 MetaEnumeration (MetaProcess *P)
 
 MetaEnumeration (MetaTable *T)
 
virtual ~MetaEnumeration () noexcept(false)
 
virtual size_type DefaultValueIndex () const
 
virtual IsoString ElementAliases () const
 
virtual IsoString ElementId (size_type idx) const =0
 
virtual int ElementValue (size_type idx) const =0
 
virtual IsoString Id () const override=0
 
bool IsEnumeration () const override
 
virtual size_type NumberOfElements () const =0
 
- Public Member Functions inherited from pcl::MetaParameter
 MetaParameter (MetaProcess *P)
 
 MetaParameter (MetaTable *T)
 
virtual ~MetaParameter () noexcept(false)
 
virtual IsoString Aliases () const
 
virtual String Comment () const
 
virtual String Description () const
 
virtual bool IsBlock () const
 
virtual bool IsBoolean () const
 
virtual bool IsNumeric () const
 
virtual bool IsReadOnly () const
 
virtual bool IsRequired () const
 
virtual bool IsString () const
 
virtual bool IsTable () const
 
virtual bool IsVariableLength () const
 
virtual bool NeedsUnlocking () const
 
virtual bool NeedsValidation () const
 
- Public Member Functions inherited from pcl::MetaObject
 MetaObject (MetaObject *parent)
 
 MetaObject (const MetaObject &)=delete
 
 MetaObject (MetaObject &&x)=delete
 
virtual ~MetaObject () noexcept(false)
 
size_type Length () const
 
MetaObjectoperator= (const MetaObject &)=delete
 
MetaObjectoperator= (MetaObject &&x)=delete
 
const MetaObjectoperator[] (size_type i) const
 
const MetaObjectParent () const
 
MetaObjectParent ()
 

Additional Inherited Members

- Public Types inherited from pcl::MetaObject
typedef IndirectArray< MetaObjectchildren_list
 

Detailed Description

MetaEnumeration represents an enumerated process parameter. An enumerated process parameter defines a finite set of unique-identifier/value associations.

Note
Important - Enumerated parameters must be implemented as 32-bit signed integers (int32). When the PixInsight core application reads or writes an enumerated parameter value, what it actually reads or writes is an enumeration value as a 32-bit signed integer, not the index of an enumeration element (which should be an unsigned integer). The best way to implement enumerated process parameters is by using the pcl_enum type.
See also
pcl_enum

Definition at line 1494 of file MetaParameter.h.

Constructor & Destructor Documentation

◆ MetaEnumeration() [1/2]

pcl::MetaEnumeration::MetaEnumeration ( MetaProcess P)
inline

Constructs a metaparameter representing an enumerated parameter of the specified process class *P.

Definition at line 1502 of file MetaParameter.h.

◆ MetaEnumeration() [2/2]

pcl::MetaEnumeration::MetaEnumeration ( MetaTable T)
inline

Constructs a metaparameter representing an enumerated value in a column of a table process parameter represented by the metatable *T. The new metaparameter is appended to the list of existing columns in the metatable *T.

Definition at line 1513 of file MetaParameter.h.

◆ ~MetaEnumeration()

virtual pcl::MetaEnumeration::~MetaEnumeration ( )
inlinevirtualnoexcept

Destroys a MetaEnumeration object.

Definition at line 1521 of file MetaParameter.h.

Member Function Documentation

◆ DefaultValueIndex()

virtual size_type pcl::MetaEnumeration::DefaultValueIndex ( ) const
inlinevirtual

Returns the enumeration index corresponding to the default value for the enumerated process parameter that this metaparameter represents.

The returned value must be in the range 0 to n-1, where n is the number of enumeration elements defined in the enumerated process parameter.

Note
The default implementation of this function returns zero.

Definition at line 1583 of file MetaParameter.h.

◆ ElementAliases()

virtual IsoString pcl::MetaEnumeration::ElementAliases ( ) const
inlinevirtual

Returns a list of alias identifiers for this enumerated parameter.

An enumerated process parameter can define one or more aliased elements. Aliased enumeration elements are useful to maintain compatibility with previous versions of a process.

The returned string is a comma-separated list of "alias_id=element_id" items. Formally:

aliased-elements-list:
   alias-specification[, aliased-elements-list]
alias-specification:
   alias-element-id = element-id

When the PixInsight core application imports a process instance (e.g., from a process icon) it automatically replaces alias enumeration identifiers with actual (current) identifiers. This allows a developer to change the enumeration identifiers of a process parameters without breaking compatibility with existing process instances.

Note
The default implementation of this member function returns an empty string (no aliases).

Definition at line 1614 of file MetaParameter.h.

◆ ElementId()

virtual IsoString pcl::MetaEnumeration::ElementId ( size_type  idx) const
pure virtual

Returns the unique enumeration identifier corresponding to the specified enumeration index idx, in the enumerated process parameter represented by this metaparameter.

Enumeration identifiers must be valid C identifiers, unique within the set of enumeration elements defined in the enumerated process parameter.

Note
Important - An enumeration index should not be confused with an enumeration value. Enumeration indices range from 0 to n-1, where n is the number of enumeration elements defined in the enumerated process parameter.

◆ ElementValue()

virtual int pcl::MetaEnumeration::ElementValue ( size_type  idx) const
pure virtual

Returns the enumeration value corresponding to the specified enumeration index idx, in the enumerated process parameter represented by this metaparameter.

Note
Important - An enumeration index should not be confused with an enumeration value. Enumeration indices range from 0 to n-1, where n is the number of enumeration elements defined in the enumerated process parameter.

◆ Id()

virtual IsoString pcl::MetaEnumeration::Id ( ) const
overridepure virtual

Returns the identifier of the process parameter that this metaparameter represents.

Each process parameter must have a valid, unique (within its parent process) C identifier.

See also
Aliases()

Implements pcl::MetaParameter.

◆ IsEnumeration()

bool pcl::MetaEnumeration::IsEnumeration ( ) const
inlineoverridevirtual

Returns true iff this metaparameter represents an enumerated process parameter. Enumerated process parameters are represented as subclasses of MetaEnumeration.

Reimplemented from pcl::MetaParameter.

Definition at line 1527 of file MetaParameter.h.

References pcl::ImageOp::Id().

◆ NumberOfElements()

virtual size_type pcl::MetaEnumeration::NumberOfElements ( ) const
pure virtual

Returns the number of enumeration elements defined in the enumerated process parameter represented by this metaparameter.

Each enumeration element is a unique-identifier/value association.

The returned value must be > 0.


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