ACF $AcfVersion:0$
Public Member Functions | Public Attributes | List of all members
iprm::CParamsManagerCompBase::ParamSet Class Reference

#include <CParamsManagerCompBase.h>

Inheritance diagram for iprm::CParamsManagerCompBase::ParamSet:
iprm::IParamsSet iprm::ISelectionParam iprm::INameParam iser::IObject iser::ISerializable iser::ISerializable iser::ISerializable istd::IChangeable istd::IChangeable istd::IChangeable istd::IPolymorphic istd::IPolymorphic istd::IPolymorphic

Public Member Functions

 ParamSet ()
 
virtual Ids GetParamIds (bool editableOnly=false) const override
 Get list of used parameter IDs in the parameter set.
 
virtual const iser::ISerializableGetParameter (const QByteArray &id) const override
 Get any parameter (read-only access).
 
virtual iser::ISerializableGetEditableParameter (const QByteArray &id) override
 Get access to editable parameter (read-write access).
 
virtual const IParamsInfoProviderGetParamsInfoProvider () const override
 Get parameter information provider.
 
virtual const IOptionsListGetSelectionConstraints () const override
 Get constraints of this parameter.
 
virtual int GetSelectedOptionIndex () const override
 Get selected index.
 
virtual bool SetSelectedOptionIndex (int index) override
 Set index of selected option.
 
virtual ISelectionParamGetSubselection (int index) const override
 Get sub-selection for specified option.
 
virtual const QString & GetName () const override
 Get the object name.
 
virtual void SetName (const QString &name) override
 Set the object name.
 
virtual bool IsNameFixed () const override
 Return true if the name is fixed (non-editable).
 
virtual QByteArray GetFactoryId () const override
 
virtual bool Serialize (iser::IArchive &archive) override
 Load or store state of this object as a archive stream.
 
virtual bool CopyFrom (const istd::IChangeable &object, istd::IChangeable::CompatibilityMode mode=CM_WITHOUT_REFS) override
 Copy this object from another one.
 
- Public Member Functions inherited from iser::ISerializable
virtual quint32 GetMinimalVersion (int versionId) const
 Get minimal needed version to correct storing of this data.
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations.
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object.
 
virtual istd::TUniqueInterfacePtr< istd::IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object.
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state.
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction.
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction.
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes.
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Public Attributes

iprm::IParamsSetSharedPtr paramSetPtr
 
QByteArray uuid
 
QString name
 
iprm::CNameParam description
 
bool isEnabled
 
int userFlags
 
CParamsManagerCompBaseparentPtr
 
UuidParam uuidParam
 
imod::CModelUpdateBridge updateBridge
 

Additional Inherited Members

- Public Types inherited from iprm::IParamsSet
typedef QSet< QByteArray > Ids
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0 , CF_ALL_DATA , CF_ANY , CF_DESTROYING ,
  CF_DELEGATED , CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0 , SO_OBSERVE = 1 << 0 , SO_COPY = 1 << 1 , SO_CLONE = 1 << 2 ,
  SO_COMPARE = 1 << 3 , SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT , CM_WITHOUT_REFS , CM_WITH_REFS , CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 
typedef QMultiMap< QByteArray, QVariant > ChangeInfoMap
 
- Public Types inherited from iprm::ISelectionParam
enum  ChangeFlags { CF_SELECTION_CHANGED = 0x67364be }
 Data model change notification flags. More...
 
enum  { NO_SELECTION = -1 }
 
- Public Types inherited from iprm::INameParam
enum  ChangeFlags { CF_RENAME = 0x15345e0 }
 Data model change notification flags. More...
 
- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes.
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set.
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set.
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set.
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event.
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event.
 

Detailed Description

Definition at line 174 of file CParamsManagerCompBase.h.

Constructor & Destructor Documentation

◆ ParamSet()

iprm::CParamsManagerCompBase::ParamSet::ParamSet ( )

Member Function Documentation

◆ CopyFrom()

virtual bool iprm::CParamsManagerCompBase::ParamSet::CopyFrom ( const istd::IChangeable object,
istd::IChangeable::CompatibilityMode  mode = CM_WITHOUT_REFS 
)
overridevirtual

Copy this object from another one.

Default implementation in istd::IChangeable does nothing.

Reimplemented from istd::IChangeable.

◆ GetEditableParameter()

virtual iser::ISerializable * iprm::CParamsManagerCompBase::ParamSet::GetEditableParameter ( const QByteArray &  id)
overridevirtual

Get access to editable parameter (read-write access).

Retrieves a parameter by its ID for modification. This method returns NULL if the parameter does not exist or is not editable.

Parameters
idID of parameter. This is an application-specific identifier that uniquely identifies the parameter within this set.
Returns
Pointer to editable parameter instance (as iser::ISerializable*) or NULL if no editable parameter exists with the given ID.
Note
Returns NULL for read-only (calculated) parameters even if they exist.
Use dynamic_cast to determine the actual parameter type before modifying.
The returned pointer is owned by the parameter set. Do not delete it.
iser::ISerializable* param = paramsSet->GetEditableParameter("threshold");
if (param)
{
// Try casting to expected type
iprm::ITextParam* textParam = dynamic_cast<iprm::ITextParam*>(param);
if (textParam)
{
textParam->SetText("10.5");
}
}
else
{
// Parameter doesn't exist or is read-only
}
Interface for an object containing simple text.
Definition ITextParam.h:76
virtual void SetText(const QString &text)=0
Set the text value.
Common class for all classes which objects can be archived or restored from archive.
See also
GetParameter

Implements iprm::IParamsSet.

◆ GetFactoryId()

virtual QByteArray iprm::CParamsManagerCompBase::ParamSet::GetFactoryId ( ) const
overridevirtual

Reimplemented from iser::IObject.

◆ GetName()

virtual const QString & iprm::CParamsManagerCompBase::ParamSet::GetName ( ) const
overridevirtual

Get the object name.

Returns
Reference to the current name as QString.
const QString& name = nameParam.GetName();
qDebug() << "Name:" << name;
See also
SetName

Implements iprm::INameParam.

◆ GetParameter()

virtual const iser::ISerializable * iprm::CParamsManagerCompBase::ParamSet::GetParameter ( const QByteArray &  id) const
overridevirtual

Get any parameter (read-only access).

Retrieves a parameter by its ID for read-only access. This method returns both editable and non-editable parameters.

Parameters
idID of parameter. This is an application-specific identifier that uniquely identifies the parameter within this set.
Returns
Pointer to parameter instance (as iser::ISerializable*) or NULL if no parameter exists with the given ID.
Note
Use dynamic_cast to determine the actual parameter type (ITextParam, ISelectionParam, etc.).
The returned pointer is owned by the parameter set. Do not delete it.
const iser::ISerializable* param = paramsSet->GetParameter("myParam");
if (param)
{
// Try casting to expected type
const iprm::ITextParam* textParam = dynamic_cast<const iprm::ITextParam*>(param);
if (textParam)
{
QString value = textParam->GetText();
}
}
virtual QString GetText() const =0
Get the text value.
See also
GetEditableParameter

Implements iprm::IParamsSet.

◆ GetParamIds()

virtual Ids iprm::CParamsManagerCompBase::ParamSet::GetParamIds ( bool  editableOnly = false) const
overridevirtual

Get list of used parameter IDs in the parameter set.

This method returns the IDs of all parameters contained in this set. Optionally, it can return only editable parameter IDs.

Parameters
editableOnlyIf true, returns only IDs of editable parameters. If false (default), returns all parameter IDs.
Returns
Set of parameter IDs (QByteArray identifiers).
// Get all parameter IDs
iprm::IParamsSet::Ids allIds = paramsSet->GetParamIds();
qDebug() << "Total parameters:" << allIds.size();
// Get only editable parameter IDs
iprm::IParamsSet::Ids editableIds = paramsSet->GetParamIds(true);
qDebug() << "Editable parameters:" << editableIds.size();
QSet< QByteArray > Ids
Definition IParamsSet.h:83

Implements iprm::IParamsSet.

◆ GetParamsInfoProvider()

virtual const IParamsInfoProvider * iprm::CParamsManagerCompBase::ParamSet::GetParamsInfoProvider ( ) const
overridevirtual

Get parameter information provider.

Retrieves the parameter information provider that can be used to obtain metadata (names and descriptions) for parameters in this set.

Returns
Pointer to IParamsInfoProvider instance, or nullptr if parameter information is not available for this parameter set.
Note
Not all parameter sets provide parameter information. Some may return nullptr if they don't support this feature.
const iprm::IParamsInfoProvider* infoProvider = paramsSet->GetParamsInfoProvider();
if (infoProvider != nullptr)
{
std::unique_ptr<iprm::IParamsInfoProvider::ParamInfo> info =
infoProvider->GetParamInfo("threshold");
if (info != nullptr)
{
qDebug() << "Parameter:" << info->name << "-" << info->description;
}
}
Provider of parameter information (name and description).
virtual std::unique_ptr< ParamInfo > GetParamInfo(const QByteArray &paramId) const =0
Get parameter information by parameter ID.
See also
IParamsInfoProvider

Implements iprm::IParamsSet.

◆ GetSelectedOptionIndex()

virtual int iprm::CParamsManagerCompBase::ParamSet::GetSelectedOptionIndex ( ) const
overridevirtual

Get selected index.

Returns the index of the currently selected option.

Returns
Index of selected option (0-based), or NO_SELECTION (-1) if no option is selected.
int index = selection.GetSelectedOptionIndex();
{
qDebug() << "No selection";
}
else
{
qDebug() << "Selected index:" << index;
}
@ NO_SELECTION
Indicates no option is currently selected.
See also
SetSelectedOptionIndex, NO_SELECTION

Implements iprm::ISelectionParam.

◆ GetSelectionConstraints()

virtual const IOptionsList * iprm::CParamsManagerCompBase::ParamSet::GetSelectionConstraints ( ) const
overridevirtual

Get constraints of this parameter.

Returns the options list that defines available choices for this selection. Constraints describe allowed parameter ranges and related information.

Returns
Pointer to IOptionsList defining available options, owned by the parameter or external manager. Do not delete.
const iprm::IOptionsList* options = selection.GetSelectionConstraints();
if (options)
{
int count = options->GetOptionsCount();
for (int i = 0; i < count; ++i)
{
QString name = options->GetOptionName(i);
qDebug() << "Option" << i << ":" << name;
}
}
Constraints of selection from set of possibilities.
virtual int GetOptionsCount() const =0
Get number of managed options.
virtual QString GetOptionName(int index) const =0
Get name of specified option.
See also
IOptionsList

Implements iprm::ISelectionParam.

◆ GetSubselection()

virtual ISelectionParam * iprm::CParamsManagerCompBase::ParamSet::GetSubselection ( int  index) const
overridevirtual

Get sub-selection for specified option.

Retrieves the hierarchical sub-selection associated with a specific option. This enables multi-level selection structures (e.g., Category -> Subcategory).

Parameters
indexIndex of the option whose sub-selection to retrieve.
Returns
Pointer to sub-selection parameter, or NULL if no sub-selection exists for this option.
Note
The returned pointer belongs to the selection's data model. Do not delete.
Sub-selections are independent selection parameters that can have their own constraints and further sub-selections.
// Get sub-selection for currently selected option
int selectedIndex = selection.GetSelectedOptionIndex();
if (selectedIndex >= 0)
{
iprm::ISelectionParam* subSelection = selection.GetSubselection(selectedIndex);
if (subSelection)
{
// Work with sub-selection
subSelection->SetSelectedOptionIndex(0);
}
}
// Check all options for sub-selections
const iprm::IOptionsList* options = selection.GetSelectionConstraints();
int count = options->GetOptionsCount();
for (int i = 0; i < count; ++i)
{
if (sub)
{
qDebug() << "Option" << i << "has a sub-selection";
}
}
Interface allowing to select single option from list of options.
virtual bool SetSelectedOptionIndex(int index)=0
Set index of selected option.
virtual ISelectionParam * GetSubselection(int index) const =0
Get sub-selection for specified option.

Implements iprm::ISelectionParam.

◆ IsNameFixed()

virtual bool iprm::CParamsManagerCompBase::ParamSet::IsNameFixed ( ) const
overridevirtual

Return true if the name is fixed (non-editable).

Indicates whether the name can be changed by users. Fixed names are typically used for system-defined or read-only objects.

Returns
true if name cannot be modified, false if name is editable.
bool canRename = !nameParam.IsNameFixed();
if (canRename)
{
// Allow user to edit name
nameParam.SetName(userInput);
}
See also
SetName

Implements iprm::INameParam.

◆ Serialize()

virtual bool iprm::CParamsManagerCompBase::ParamSet::Serialize ( iser::IArchive archive)
overridevirtual

Load or store state of this object as a archive stream.

Type of operation is depending on archive type.

See also
iser::IArchive

Implements iser::ISerializable.

◆ SetName()

virtual void iprm::CParamsManagerCompBase::ParamSet::SetName ( const QString &  name)
overridevirtual

Set the object name.

Changes the name of this parameter.

Parameters
nameNew name value.
Note
If IsNameFixed() returns true, setting the name may be restricted.
Triggers CF_RENAME notification on change.
if (!nameParam.IsNameFixed())
{
nameParam.SetName("New Name");
}
See also
GetName, IsNameFixed, CF_RENAME

Implements iprm::INameParam.

◆ SetSelectedOptionIndex()

virtual bool iprm::CParamsManagerCompBase::ParamSet::SetSelectedOptionIndex ( int  index)
overridevirtual

Set index of selected option.

Changes the selected option to the specified index.

Parameters
indexIndex of the option to select (0-based), or NO_SELECTION to clear the selection.
Returns
true if selection change was possible and successful, false otherwise.
Note
Returns false if index is out of range or the option is disabled.
Triggers CF_SELECTION_CHANGED notification on success.
// Select third option
bool success = selection.SetSelectedOptionIndex(2);
if (success)
{
qDebug() << "Selection changed";
}
// Clear selection
selection.SetSelectedOptionIndex(iprm::ISelectionParam::NO_SELECTION);
See also
GetSelectedOptionIndex, CF_SELECTION_CHANGED

Implements iprm::ISelectionParam.

Member Data Documentation

◆ description

iprm::CNameParam iprm::CParamsManagerCompBase::ParamSet::description

Definition at line 211 of file CParamsManagerCompBase.h.

◆ isEnabled

bool iprm::CParamsManagerCompBase::ParamSet::isEnabled

Definition at line 212 of file CParamsManagerCompBase.h.

◆ name

QString iprm::CParamsManagerCompBase::ParamSet::name

Definition at line 210 of file CParamsManagerCompBase.h.

◆ paramSetPtr

iprm::IParamsSetSharedPtr iprm::CParamsManagerCompBase::ParamSet::paramSetPtr

Definition at line 208 of file CParamsManagerCompBase.h.

◆ parentPtr

CParamsManagerCompBase* iprm::CParamsManagerCompBase::ParamSet::parentPtr

Definition at line 214 of file CParamsManagerCompBase.h.

◆ updateBridge

imod::CModelUpdateBridge iprm::CParamsManagerCompBase::ParamSet::updateBridge

Definition at line 216 of file CParamsManagerCompBase.h.

◆ userFlags

int iprm::CParamsManagerCompBase::ParamSet::userFlags

Definition at line 213 of file CParamsManagerCompBase.h.

◆ uuid

QByteArray iprm::CParamsManagerCompBase::ParamSet::uuid

Definition at line 209 of file CParamsManagerCompBase.h.

◆ uuidParam

UuidParam iprm::CParamsManagerCompBase::ParamSet::uuidParam

Definition at line 215 of file CParamsManagerCompBase.h.


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