SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
smtk::attribute::ValueItemDefinitionTemplate< DataT > Class Template Reference
Inheritance diagram for smtk::attribute::ValueItemDefinitionTemplate< DataT >:
[legend]
Collaboration diagram for smtk::attribute::ValueItemDefinitionTemplate< DataT >:
[legend]

Public Types

typedef DataT DataType
 

Public Member Functions

const DataT & defaultValue () const
 
const DataT & defaultValue (std::size_t element) const
 
const std::vector< DataT > & defaultValues () const
 
bool setDefaultValue (const DataT &val)
 Set the default value for an attribute.
 
bool setDefaultValue (const std::vector< DataT > &val)
 Set the default value for an attribute. More...
 
const DataT & discreteValue (std::size_t element) const
 
void addDiscreteValue (const DataT &val)
 
void addDiscreteValue (const DataT &val, const std::string &discreteEnum)
 
void clearDiscreteValues ()
 
bool hasRange () const override
 
bool hasMinRange () const
 
const DataT & minRange () const
 
bool minRangeInclusive () const
 
bool setMinRange (const DataT &minVal, bool isInclusive)
 
bool hasMaxRange () const
 
const DataT & maxRange () const
 
bool maxRangeInclusive () const
 
bool setMaxRange (const DataT &maxVal, bool isInclusive)
 
void clearRange ()
 
int findDiscreteIndex (const DataT &val) const
 
bool isValueValid (const DataT &val) const
 
- Public Member Functions inherited from smtk::attribute::ValueItemDefinition
 smtkTypeMacro (smtk::attribute::ValueItemDefinition)
 
 ValueItemDefinition (const std::string &myname)
 
const std::string & units () const
 
void setUnits (const std::string &newUnits)
 
bool isDiscrete () const
 
std::size_t numberOfDiscreteValues () const
 
const std::string & discreteEnum (std::size_t ith) const
 
bool getEnumIndex (const std::string &enumVal, std::size_t &index) const
 
int defaultDiscreteIndex () const
 
void setDefaultDiscreteIndex (int discreteIndex)
 
bool allowsExpressions () const
 
bool isValidExpression (const smtk::attribute::AttributePtr &exp) const
 
std::string expressionType () const
 
void setExpressionType (const std::string &etype)
 
void setExpressionDefinition (const smtk::attribute::DefinitionPtr &exp)
 
smtk::attribute::DefinitionPtr expressionDefinition (const smtk::attribute::ResourcePtr &attResource) const
 
void buildExpressionItem (ValueItem *vitem) const
 
void buildChildrenItems (ValueItem *vitem) const
 
bool hasDefault () const
 
std::size_t numberOfRequiredValues () const
 
bool setNumberOfRequiredValues (std::size_t esize)
 
std::size_t maxNumberOfValues () const
 
bool setMaxNumberOfValues (std::size_t esize)
 
bool isExtensible () const
 
void setIsExtensible (bool mode)
 
bool hasValueLabels () const
 
bool usingCommonLabel () const
 
void setValueLabel (std::size_t element, const std::string &elabel)
 
void setCommonValueLabel (const std::string &elabel)
 
std::string valueLabel (std::size_t element) const
 
bool isDiscreteIndexValid (int index) const
 
std::size_t numberOfChildrenItemDefinitions () const
 For conditional children items based on the item's current discrete value.
 
const std::map< std::string, smtk::attribute::ItemDefinitionPtr > & childrenItemDefinitions () const
 
bool hasChildItemDefinition (const std::string &itemName) const
 
bool hasChildItemDefinition (const std::string &valueName, const std::string &itemName)
 
bool addChildItemDefinition (smtk::attribute::ItemDefinitionPtr cdef)
 
bool addItemDefinition (smtk::attribute::ItemDefinitionPtr cdef)
 
template<typename T >
smtk::internal::shared_ptr_type< T >::SharedPointerType addItemDefinition (const std::string &idName)
 
bool addConditionalItem (const std::string &enumValue, const std::string &itemName)
 
std::vector< std::string > conditionalItems (const std::string &enumValue) const
 
std::vector< std::string > relevantEnums (bool includeCategories, const std::set< std::string > &testCategories, bool includeReadAccess, unsigned int readAccessLevel) const
 Return the enum strings that pass a set of categories and/or specified advance read access level.
 
void setEnumCategories (const std::string &enumValue, const smtk::attribute::Categories::Set &cats)
 Set/Get the set of categories associated with a value Enum.
 
void addEnumCategory (const std::string &enumValue, const std::string &cat)
 Set/Get the set of categories associated with a value Enum.
 
const smtk::attribute::Categories::SetenumCategories (const std::string &enumValue) const
 Set/Get the set of categories associated with a value Enum.
 
void setEnumAdvanceLevel (const std::string &enumValue, unsigned int level)
 Set/Get advance level associated with associated with a value Enum.
 
void unsetEnumAdvanceLevel (const std::string &enumValue)
 Set/Get advance level associated with associated with a value Enum.
 
unsigned int enumAdvanceLevel (const std::string &enumValue) const
 Set/Get advance level associated with associated with a value Enum.
 
bool hasEnumAdvanceLevel (const std::string &enumValue) const
 Set/Get advance level associated with associated with a value Enum.
 
const std::map< std::string, unsigned int > enumAdvanceLevelInfo () const
 Set/Get advance level associated with associated with a value Enum.
 
- Public Member Functions inherited from smtk::attribute::ItemDefinition
 smtkTypeMacroBase (smtk::attribute::ItemDefinition)
 
const std::string & name () const
 
virtual Item::Type type () const =0
 
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
 
virtual smtk::attribute::ItemPtr buildItem (Attribute *owningAttribute, int itemPosition) const =0
 
virtual smtk::attribute::ItemPtr buildItem (Item *owningItem, int position, int subGroupPosition) const =0
 
virtual smtk::attribute::ItemDefinitionPtr createCopy (smtk::attribute::ItemDefinition::CopyInfo &info) const =0
 
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.
 

Protected Member Functions

 ValueItemDefinitionTemplate (const std::string &myname)
 
void copyTo (ValueItemDefinitionPtr def, smtk::attribute::ItemDefinition::CopyInfo &info) const
 
void updateDiscreteValue () override
 
- Protected Member Functions inherited from smtk::attribute::ValueItemDefinition
void copyTo (ValueItemDefinitionPtr def, smtk::attribute::ItemDefinition::CopyInfo &info) const
 
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< DataT > m_defaultValue
 
DataT m_minRange
 
bool m_minRangeSet
 
bool m_minRangeInclusive
 
DataT m_maxRange
 
bool m_maxRangeSet
 
bool m_maxRangeInclusive
 
std::vector< DataT > m_discreteValues
 
DataT m_dummy
 
- Protected Attributes inherited from smtk::attribute::ValueItemDefinition
bool m_hasDefault
 
bool m_useCommonLabel
 
std::vector< std::string > m_valueLabels
 
std::vector< std::string > m_discreteValueEnums
 
int m_defaultDiscreteIndex
 
std::size_t m_numberOfRequiredValues
 
std::size_t m_maxNumberOfValues
 
bool m_isExtensible
 
std::string m_units
 
std::string m_expressionType
 
smtk::attribute::ComponentItemDefinitionPtr m_expressionDefinition
 
std::map< std::string, smtk::attribute::ItemDefinitionPtrm_itemDefs
 
std::map< std::string, std::set< std::string > > m_itemToValueAssociations
 
std::map< std::string, std::vector< std::string > > m_valueToItemAssociations
 
std::map< std::string, smtk::attribute::Categories::Setm_valueToCategoryAssociations
 
std::map< std::string, unsigned int > m_valueToAdvanceLevelAssociations
 
- 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
 

Member Function Documentation

◆ setDefaultValue()

template<typename DataT >
bool smtk::attribute::ValueItemDefinitionTemplate< DataT >::setDefaultValue ( const std::vector< DataT > &  dvalue)

Set the default value for an attribute.

 This variant takes an array of values so that
 vector quantities can have a different default
 for each component.

 However, a single default can always be specified
 (even for vector-valued attributes), and **must**
 be specified for discrete and extensible attributes.

 When a single default is provided but the attribute
 is vector-valued, then the default is used for each
 component.

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