SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
11 #ifndef smtk_attribute_Categories_h
12 #define smtk_attribute_Categories_h
14 #include "smtk/CoreExports.h"
15 #include "smtk/SystemConfig.h"
60 class SMTKCORE_EXPORT
Set
86 m_includedCategories = values;
94 m_excludedCategories = values;
97 void insertInclusion(
const std::string& val) { m_includedCategories.insert(val); }
99 void insertExclusion(
const std::string& val) { m_excludedCategories.insert(val); }
107 m_includedCategories.clear();
108 m_excludedCategories.clear();
114 return m_includedCategories.empty() && m_excludedCategories.empty() &&
115 (m_combinationMode == CombinationMode::And);
128 bool passes(
const std::set<std::string>& cats)
const;
129 bool passes(
const std::string& cat)
const;
131 static bool passesCheck(
132 const std::set<std::string>& cats,
133 const std::set<std::string>& testSet,
137 int compare(
const Set& rhs)
const;
138 std::string convertToString(
const std::string& prefix =
"")
const;
142 m_excludeMode{ Set::CombinationMode::Or }, m_combinationMode{ Set::CombinationMode::And };
143 std::set<std::string> m_includedCategories, m_excludedCategories;
150 void clear() { m_stack.clear(); }
151 bool passes(
const std::set<std::string>& cats)
const;
152 bool passes(
const std::string& cat)
const;
153 std::string convertToString(
const std::string& prefix =
"")
const;
154 std::set<std::string> categoryNames()
const;
155 bool empty()
const {
return m_stack.empty(); }
157 bool operator<(
const Stack& rhs)
const;
160 std::vector<std::pair<CombinationMode, Set>> m_stack;
166 bool passes(
const std::set<std::string>& cats)
const;
167 bool passes(
const std::string& cat)
const;
172 bool insert(
const Stack& stack);
178 std::size_t
size()
const {
return m_stacks.size(); }
181 const std::set<Stack>&
stacks()
const {
return m_stacks; }
183 std::set<std::string> categoryNames()
const;
185 std::string convertToString()
const;
188 static std::string combinationModeAsString(Set::CombinationMode mode);
189 static bool combinationModeFromString(
const std::string& val, Set::CombinationMode& mode);
192 std::set<Stack> m_stacks;
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
void eraseExclusion(const std::string &val)
Remove a category name from the exclusion set.
Definition: Categories.h:103
Definition: Categories.h:146
void setExclusionMode(const Set::CombinationMode &newMode)
Set/Get the CombinationMode associated with the excluded categories.
Definition: Categories.h:78
const std::set< std::string > & includedCategoryNames() const
Return the set of category names associated with the inclusion set.
Definition: Categories.h:81
std::size_t inclusionSize() const
Returns the number of category names in the inclusion set.
Definition: Categories.h:118
void insertExclusion(const std::string &val)
Add a category name to the exclusion set.
Definition: Categories.h:99
std::size_t size() const
Return the number of stacks in this instance.
Definition: Categories.h:178
Set::CombinationMode inclusionMode() const
Set/Get the CombinationMode associated with the included categories.
Definition: Categories.h:72
void insertInclusion(const std::string &val)
Add a category name to the inclusion set.
Definition: Categories.h:97
Set::CombinationMode combinationMode() const
Set/Get the how the sets of included and excluded categories are combined.
Definition: Categories.h:67
void reset()
Remove all stacks from this instance.
Definition: Categories.h:176
Set::CombinationMode exclusionMode() const
Set/Get the CombinationMode associated with the excluded categories.
Definition: Categories.h:77
void setInclusionMode(const Set::CombinationMode &newMode)
Set/Get the CombinationMode associated with the included categories.
Definition: Categories.h:73
bool empty() const
Returns true if both the inclusion and exclusion sets are empty and the combination mode is set to An...
Definition: Categories.h:112
std::size_t exclusionSize() const
Returns the number of category names in the exclusion set.
Definition: Categories.h:120
void setInclusions(const std::set< std::string > &values, Set::CombinationMode mode)
Set the mode and category names of the inclusion set.
Definition: Categories.h:83
Represents the category constraints associated with an Attribute, Attribute Definition,...
Definition: Categories.h:32
void reset()
Remove all names from both inclusion and exclusion sets.
Definition: Categories.h:105
const std::set< Stack > & stacks() const
Return the sets contained in this instance.
Definition: Categories.h:181
Categories::Set represents a single category constraint used by the Categories class.
Definition: Categories.h:60
const std::set< std::string > & excludedCategoryNames() const
Return the set of category names associated with the exclusion set.
Definition: Categories.h:89
CombinationMode
Definition: Categories.h:35
void eraseInclusion(const std::string &val)
Remove a category name from the inclusion set.
Definition: Categories.h:101
void setExclusions(const std::set< std::string > &values, Set::CombinationMode mode)
Set the mode and category names of the exclusion set.
Definition: Categories.h:91