SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A definition for attribute items that store Resources as values. More...
#include <ResourceItemDefinition.h>
Public Member Functions | |
smtkTypeMacro (smtk::attribute::ResourceItemDefinition) | |
smtkSuperclassMacro (ReferenceItemDefinition) | |
~ResourceItemDefinition () override | |
Destructor. | |
Item::Type | type () const override |
Return the type of storage used by items defined by this class. | |
bool | isValueValid (smtk::resource::ConstPersistentObjectPtr value) const override |
smtk::attribute::ItemPtr | buildItem (Attribute *owningAttribute, int itemPosition) const override |
Construct an item from the definition given its owning attribute and position. | |
smtk::attribute::ItemPtr | buildItem (Item *owningItem, int position, int subGroupPosition) const override |
Construct an item from the definition given its owning item and position. | |
smtk::attribute::ItemDefinitionPtr | createCopy (smtk::attribute::ItemDefinition::CopyInfo &info) const override |
bool | setAcceptsEntries (const std::string &typeName, bool accept) |
bool | setRejectsEntries (const std::string &typeName, bool add) |
virtual bool | setAcceptsEntries (const std::string &typeName, const std::string &queryString, bool accept) |
virtual bool | setRejectsEntries (const std::string &typeName, const std::string &queryString, bool accept) |
Public Member Functions inherited from smtk::attribute::ReferenceItemDefinition | |
smtkTypeMacro (ReferenceItemDefinition) | |
Construct an item definition given a name. Names should be unique and non-empty. | |
smtkSuperclassMacro (ItemDefinition) | |
const std::multimap< std::string, std::string > & | acceptableEntries () const |
virtual bool | setAcceptsEntries (const std::string &typeName, const std::string &queryString, bool accept) |
void | clearAcceptableEntries () |
const std::multimap< std::string, std::string > & | rejectedEntries () const |
virtual bool | setRejectsEntries (const std::string &typeName, const std::string &queryString, bool accept) |
void | clearRejectedEntries () |
void | setEnforcesCategories (bool mode) |
bool | enforcesCategories () const |
std::size_t | numberOfRequiredValues () const |
Return the number of values required by this definition. | |
void | setNumberOfRequiredValues (std::size_t esize) |
Set the number of values required by this definition. Use 0 when there is no requirement. | |
bool | isExtensible () const |
void | setIsExtensible (bool extensible) |
std::size_t | maxNumberOfValues () const |
void | setMaxNumberOfValues (std::size_t maxNum) |
Set the maximum number of values accepted (or 0 for no limit). | |
bool | hasValueLabels () const |
Return whether the definition provides labels for each value. | |
std::string | valueLabel (std::size_t element) const |
Return the label for the i-th value. | |
void | setValueLabel (std::size_t element, const std::string &elabel) |
Set the label for the i-th value in the item. | |
void | setCommonValueLabel (const std::string &elabel) |
Indicate that all values share the elabel provided. | |
bool | usingCommonLabel () const |
Returns true when all values share a common label and false otherwise. | |
void | setLockType (smtk::resource::LockType val) |
Set/Get the reference resource's lock type (Read/Write/DoNotLock) for read lock, write lock or bypass lock. More... | |
smtk::resource::LockType | lockType () const |
smtk::resource::Links::RoleType | role () const |
Get the reference's role when generating links between the containing attribute and the reference item. More... | |
void | setRole (const smtk::resource::Links::RoleType &role) |
Set the reference's role when generating links between the containing attribute and the reference item. More... | |
void | setHoldReference (bool choice) |
Set/Get a flag to determine whether the ReferenceItem should keep an assigned reference in memory (i.e. More... | |
bool | holdReference () const |
bool | onlyResources () const |
std::size_t | numberOfChildrenItemDefinitions () const |
Return the number of children item definitions. | |
const std::map< std::string, smtk::attribute::ItemDefinitionPtr > & | childrenItemDefinitions () const |
Return the map of children item definitions. More... | |
bool | hasChildItemDefinition (const std::string &itemName) const |
returns true if this item has a child item definition of itemName | |
bool | addChildItemDefinition (smtk::attribute::ItemDefinitionPtr cdef) |
Adds a children item definition to this item definition. More... | |
bool | addItemDefinition (smtk::attribute::ItemDefinitionPtr cdef) |
This method is identical to addChildItemDefinition and exists for JSON serialization. | |
template<typename T > | |
smtk::internal::shared_ptr_type< T >::SharedPointerType | addItemDefinition (const std::string &idName) |
std::size_t | addConditional (const std::string &resourceQuery, const std::string &componentQuery, const std::vector< std::string > &itemNames) |
Add a new conditional to the definition. More... | |
bool | hasChildItemDefinition (std::size_t ith, const std::string &itemName) |
returns true if ith conditional has a child item definition of itemName | |
std::size_t | numberOfConditionals () const |
Return the number of conditionals. | |
const std::vector< std::vector< std::string > > & | conditionalInformation () const |
Return the conditional item name information. | |
const std::vector< std::string > & | conditionalItems (std::size_t ith) const |
Return the vector of item names that correspond to the i th conditional. | |
const std::vector< std::string > & | resourceQueries () const |
Return the vector of resource queries of all conditionals. | |
const std::vector< std::string > & | componentQueries () const |
Return the vector of component queries of all conditionals. | |
void | buildChildrenItems (ReferenceItem *ritem) const |
std::size_t | testConditionals (PersistentObjectPtr &objet) const |
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::Categories & | categories () const |
Returns the categories (both explicitly assigned and inherited) associated to the Item Definition. More... | |
smtk::attribute::Categories::Set & | localCategories () |
Returns the categories::Set explicitly assigned to the Items Definition. | |
const smtk::attribute::Categories::Set & | localCategories () 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 | |
const shared_ptr< units::System > & | unitsSystem () const |
Return the unitsSystem of the Definition. | |
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 Tag * | tag (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. | |
Tag * | tag (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::ResourceItemDefinitionPtr | New (const std::string &sname) |
Static Public Member Functions inherited from smtk::attribute::ReferenceItemDefinition | |
static ReferenceItemDefinitionPtr | New (const std::string &name) |
Protected Member Functions | |
ResourceItemDefinition (const std::string &myName) | |
Construct an item definition given a name. Names should be unique and non-empty. | |
Protected Member Functions inherited from smtk::attribute::ReferenceItemDefinition | |
ReferenceItemDefinition (const std::string &myName) | |
void | copyTo (Ptr dst, smtk::attribute::ItemDefinition::CopyInfo &info) const |
Overwrite dst with a copy of this instance. | |
bool | checkResource (const smtk::resource::Resource &rsrc) const |
Return whether a resource is accepted by this definition. Used internally by isValueValid(). | |
bool | checkComponent (const smtk::resource::Component *comp) const |
Return whether a component is accepted by this definition. More... | |
bool | checkCategories (const smtk::resource::Component *comp) const |
Return whether a component passes the category requirements. More... | |
void | applyCategories (const smtk::attribute::Categories::Stack &inheritedFromParent, smtk::attribute::Categories &inheritedToParent) override |
void | setUnitsSystem (const shared_ptr< units::System > &unitsSystem) override |
Set the unitsSystem of the Definition. More... | |
Protected Member Functions inherited from smtk::attribute::ItemDefinition | |
ItemDefinition (const std::string &myname) | |
void | copyTo (ItemDefinitionPtr def) const |
virtual void | applyAdvanceLevels (const unsigned int &readLevelFromParent, const unsigned int &writeLevelFromParent) |
Additional Inherited Members | |
Public Types inherited from smtk::attribute::ReferenceItemDefinition | |
using | PersistentObjectPtr = smtk::resource::PersistentObjectPtr |
Static Public Attributes inherited from smtk::attribute::ReferenceItemDefinition | |
static constexpr std::size_t | s_invalidIndex = SIZE_MAX |
Constant used to indicate an invalid conditional index. | |
Protected Attributes inherited from smtk::attribute::ReferenceItemDefinition | |
bool | m_useCommonLabel |
std::vector< std::string > | m_valueLabels |
bool | m_isExtensible |
std::size_t | m_numberOfRequiredValues |
std::size_t | m_maxNumberOfValues |
std::multimap< std::string, std::string > | m_acceptable |
std::multimap< std::string, std::string > | m_rejected |
smtk::resource::LockType | m_lockType |
smtk::resource::Links::RoleType | m_role |
bool | m_holdReference |
bool | m_enforcesCategories = false |
std::map< std::string, smtk::attribute::ItemDefinitionPtr > | m_itemDefs |
std::vector< std::string > | m_resourceQueries |
std::vector< std::string > | m_componentQueries |
std::vector< std::vector< std::string > > | m_conditionalItemNames |
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 |
std::shared_ptr< units::System > | m_unitsSystem |
A definition for attribute items that store Resources as values.