SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
smtk::attribute::GroupItemDefinition Class Reference

A GroupItemDefinition represents a collection of Item Definitions. More...

#include <GroupItemDefinition.h>

Inheritance diagram for smtk::attribute::GroupItemDefinition:
[legend]
Collaboration diagram for smtk::attribute::GroupItemDefinition:
[legend]

Public Member Functions

 smtkTypeMacro (smtk::attribute::GroupItemDefinition)
 
Item::Type type () const override
 
std::size_t numberOfItemDefinitions () const
 
smtk::attribute::ItemDefinitionPtr itemDefinition (int ith) const
 
bool addItemDefinition (smtk::attribute::ItemDefinitionPtr cdef)
 
template<typename T >
smtk::internal::shared_ptr_type< T >::SharedPointerType addItemDefinition (const std::string &inName)
 
bool removeItemDefinition (ItemDefinitionPtr itemDef)
 This method will only remove the specified ItemDefinition (if it exists) from the class internals. More...
 
int findItemPosition (const std::string &name) const
 
std::size_t numberOfRequiredGroups () const
 
bool setNumberOfRequiredGroups (std::size_t gsize)
 Returns false if gsize is greater than max number of groups (and max number > 0)
 
bool hasSubGroupLabels () const
 
std::size_t maxNumberOfGroups () const
 Returns or Sets the maximum number of groups that items from this def can have. More...
 
bool setMaxNumberOfGroups (std::size_t esize)
 Returns false if the new max is less than the number of required groups and is not 0.
 
void setSubGroupLabel (std::size_t element, const std::string &elabel)
 
void setCommonSubGroupLabel (const std::string &elabel)
 
bool usingCommonSubGroupLabel () const
 
std::string subGroupLabel (std::size_t element) const
 
smtk::attribute::ItemPtr buildItem (Attribute *owningAttribute, int itemPosition) const override
 
smtk::attribute::ItemPtr buildItem (Item *owningItem, int position, int subGroupPosition) const override
 
void buildGroup (smtk::attribute::GroupItem *group, int subGroupPosition) const
 
smtk::attribute::ItemDefinitionPtr createCopy (smtk::attribute::ItemDefinition::CopyInfo &info) const override
 
bool isExtensible () const
 Returns or sets the def's extensibility property. More...
 
void setIsExtensible (bool mode)
 Returns or sets the def's extensibility property. More...
 
void setIsConditional (bool value)
 Returns or sets the definition's conditional property. More...
 
bool isConditional () const
 Returns or sets the definition's conditional property. More...
 
void setMinNumberOfChoices (unsigned int value)
 Returns or sets the default minimum number of choices that must be set for GroupItems, whose Conditional property is true, to be considered valid. If set to 0 (default) then there is no minimum number.
 
unsigned int minNumberOfChoices () const
 Returns or sets the default minimum number of choices that must be set for GroupItems, whose Conditional property is true, to be considered valid. If set to 0 (default) then there is no minimum number.
 
void setMaxNumberOfChoices (unsigned int value)
 Returns or sets the default maximum number of choices that must be set for GroupItems, whose Conditional property is true, to be considered valid. If set to 0 (default) then there is no maximum number.
 
unsigned int maxNumberOfChoices () const
 Returns or sets the default maximum number of choices that must be set for GroupItems, whose Conditional property is true, to be considered valid. If set to 0 (default) then there is no maximum number.
 
- Public Member Functions inherited from smtk::attribute::ItemDefinition
 smtkTypeMacroBase (smtk::attribute::ItemDefinition)
 
const std::string & name () const
 
const std::string & label () const
 
void setLabel (const std::string &newLabel)
 
int version () const
 
void setVersion (int myVersion)
 
bool isOptional () const
 
void setIsOptional (bool isOptionalValue)
 
bool isEnabledByDefault () const
 
void setIsEnabledByDefault (bool isEnabledByDefaultValue)
 
const smtk::attribute::Categoriescategories () const
 Returns the categories (both explicitly assigned and inherited) associated to the Item Definition. More...
 
smtk::attribute::Categories::SetlocalCategories ()
 Returns the categories::Set explicitly assigned to the Items Definition.
 
const smtk::attribute::Categories::SetlocalCategories () const
 
void setLocalCategories (const smtk::attribute::Categories::Set &catSet)
 Sets the local categories. More...
 
unsigned int advanceLevel (int mode=0) const
 
unsigned int localAdvanceLevel (int mode=0) const
 
void setLocalAdvanceLevel (int mode, unsigned int level)
 
void setLocalAdvanceLevel (unsigned int level)
 
void unsetLocalAdvanceLevel (int mode=0)
 
bool hasLocalAdvanceLevelInfo (int mode=0) const
 
const std::string & detailedDescription () const
 
void setDetailedDescription (const std::string &text)
 
const std::string & briefDescription () const
 
void setBriefDescription (const std::string &text)
 
const Tags & tags () const
 return the smtk::attribute::Tags associated with the Definition
 
bool isOkToInherit () const
 Indicates if the Definition can inherit categories based on it's owning ItemDefinition or its owning Attribute Definition. More...
 
void setIsOkToInherit (bool isOkToInheritValue)
 Indicates if the Definition can inherit categories based on it's owning ItemDefinition or its owning Attribute Definition. More...
 
Categories::CombinationMode categoryInheritanceMode () const
 Determines how the Definition should combine its local category Set with the category constraints being inherited from it's owning Attribute or Item Definition.
 
void setCategoryInheritanceMode (Categories::CombinationMode mode)
 Determines how the Definition should combine its local category Set with the category constraints being inherited from it's owning Attribute or Item Definition.
 
const Tagtag (const std::string &name) const
 Return a pointer to a smtk::attribute::Tag with a given name. If the Tag does not exist, return a null pointer.
 
Tagtag (const std::string &name)
 Return a pointer to a smtk::attribute::Tag with a given name. If the Tag does not exist, return a null pointer.
 
bool addTag (const Tag &tag)
 Add/Remove a smtk::attribute::Tag from a Definition.
 
bool removeTag (const std::string &name)
 Add/Remove a smtk::attribute::Tag from a Definition.
 

Static Public Member Functions

static smtk::attribute::GroupItemDefinitionPtr New (const std::string &myName)
 

Protected Member Functions

 GroupItemDefinition (const std::string &myname)
 
void applyCategories (const smtk::attribute::Categories::Stack &inheritedFromParent, smtk::attribute::Categories &inheritedToParent) override
 
void applyAdvanceLevels (const unsigned int &readLevelFromParent, const unsigned int &writeLevelFromParent) override
 
- Protected Member Functions inherited from smtk::attribute::ItemDefinition
 ItemDefinition (const std::string &myname)
 
void copyTo (ItemDefinitionPtr def) const
 

Protected Attributes

std::vector< smtk::attribute::ItemDefinitionPtrm_itemDefs
 
std::map< std::string, int > m_itemDefPositions
 
std::vector< std::string > m_labels
 
std::size_t m_numberOfRequiredGroups
 
std::size_t m_maxNumberOfGroups
 
bool m_isExtensible
 
bool m_useCommonLabel
 
bool m_isConditional
 
unsigned int m_maxNumberOfChoices
 
unsigned int m_minNumberOfChoices
 
- Protected Attributes inherited from smtk::attribute::ItemDefinition
int m_version
 
bool m_isOptional
 
bool m_isEnabledByDefault
 
std::string m_label
 
attribute::Categories::Set m_localCategories
 
attribute::Categories m_categories
 
std::string m_detailedDescription
 
std::string m_briefDescription
 
bool m_hasLocalAdvanceLevelInfo [2]
 
unsigned int m_localAdvanceLevel [2]
 
unsigned int m_advanceLevel [2]
 
attribute::Tags m_tags
 
Categories::CombinationMode m_combinationMode
 

Detailed Description

A GroupItemDefinition represents a collection of Item Definitions.

When instanced the resulting Group Item will contain zero or more groups of Items instanced from this collection of Item Definitions.

Member Function Documentation

◆ isConditional()

bool smtk::attribute::GroupItemDefinition::isConditional ( ) const
inline

Returns or sets the definition's conditional property.

If the Conditional Property is true, then the Group Item represents a collection of choices. All of the Group's Item Definitions will automatically be marked optional. in additional, the resulting GroupItem will use its minNumberOfChoices and maxNumberOfChoices properties to determine its validity. Default is false.

◆ isExtensible()

bool smtk::attribute::GroupItemDefinition::isExtensible ( ) const
inline

Returns or sets the def's extensibility property.

If true then items from this def can have a variable number of groups. The number of sub groups is always <= to number of required groups and max number of groups (provided max number of groups > 0) Default value is false.

◆ maxNumberOfGroups()

std::size_t smtk::attribute::GroupItemDefinition::maxNumberOfGroups ( ) const
inline

Returns or Sets the maximum number of groups that items from this def can have.

If 0 is returned then there is no max limit. Default value is 0 Note that this is used only when the def is extensible

◆ removeItemDefinition()

bool GroupItemDefinition::removeItemDefinition ( ItemDefinitionPtr  itemDef)

This method will only remove the specified ItemDefinition (if it exists) from the class internals.

Warning: It is up to the caller to ensure integrity of the attribute::Resource instance (e.g. Attribute instances/ Items created using this ItemDefinition need to be cleansed from the resource).

◆ setIsConditional()

void smtk::attribute::GroupItemDefinition::setIsConditional ( bool  value)
inline

Returns or sets the definition's conditional property.

If the Conditional Property is true, then the Group Item represents a collection of choices. All of the Group's Item Definitions will automatically be marked optional. in additional, the resulting GroupItem will use its minNumberOfChoices and maxNumberOfChoices properties to determine its validity. Default is false.

◆ setIsExtensible()

void GroupItemDefinition::setIsExtensible ( bool  mode)

Returns or sets the def's extensibility property.

If true then items from this def can have a variable number of groups. The number of sub groups is always <= to number of required groups and max number of groups (provided max number of groups > 0) Default value is false.


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