67 #ifndef _ClassTreeMask_H__ 68 #define _ClassTreeMask_H__ 100 void include(
bool overwrite =
true);
101 void exclude(
bool overwrite =
true);
102 void setIncluded(
bool bIncluded,
bool overwrite =
true);
109 inline bool isExcluded()
const {
return (!this->bIncluded_); }
115 inline bool hasSubnodes()
const {
return !this->subnodes_.empty(); }
118 void deleteAllSubnodes();
154 explicit operator bool()
const;
159 std::stack<std::pair<std::list<ClassTreeMaskNode*>::iterator, std::list<ClassTreeMaskNode*>::iterator>>
nodes_;
196 void include(
const Identifier* subclass,
bool overwrite =
true,
bool clean =
true);
197 void exclude(
const Identifier* subclass,
bool overwrite =
true,
bool clean =
true);
198 void add(
const Identifier* subclass,
bool bInclude,
bool overwrite =
true,
bool clean =
true);
200 void includeSingle(
const Identifier* subclass,
bool clean =
true);
201 void excludeSingle(
const Identifier* subclass,
bool clean =
true);
202 void addSingle(
const Identifier* subclass,
bool bInclude,
bool clean =
true);
207 bool isIncluded(
const Identifier* subclass)
const;
208 bool isExcluded(
const Identifier* subclass)
const;
287 inline bool operator==(
BaseObject* pointer)
const {
return (this->objectIterator_ && (*this->objectIterator_) == pointer) || (!this->objectIterator_ && pointer ==
nullptr); }
289 inline bool operator!=(
BaseObject* pointer)
const {
return (this->objectIterator_ && (*this->objectIterator_) != pointer) || (!this->objectIterator_ && pointer !=
nullptr); }
291 inline explicit operator bool()
const {
return this->objectIterator_.operator bool(); }
constexpr bool operator!=(bool x, tribool y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: tribool.h:128
The BaseObject is the parent of all classes representing an instance in the game. ...
Definition: BaseObject.h:63
std::list< ClassTreeMaskNode * > rootlist_
A list for internal use (it only stores the root-node)
Definition: ClassTreeMask.h:160
bool operator!=(BaseObject *pointer) const
Returns true if the ClassTreeMaskObjectIterator doesn't point at the given object.
Definition: ClassTreeMask.h:289
The ClassTreeMask is a set of rules, containing the information for each class whether it's included ...
Definition: ClassTreeMask.h:187
The Iterator allows to iterate through a given ObjectList.
Definition: CorePrereqs.h:192
InputManager::State operator|=(InputManager::State &lval, InputManager::State rval)
Defines the |= operator for easier use.
Definition: InputManager.cc:76
Shared library macros, enums, constants and forward declarations for the core library ...
bool operator==(BaseObject *pointer) const
Returns true if the ClassTreeMaskObjectIterator points at the given object.
Definition: ClassTreeMask.h:287
TiXmlString operator+(const TiXmlString &a, const TiXmlString &b)
Definition: tinystr.cpp:86
ClassTreeMaskNode * root_
The root-node of the internal rule-tree, usually BaseObject.
Definition: ClassTreeMask.h:249
bool isIncluded() const
Tells if the rule is "included" or not.
Definition: ClassTreeMask.h:107
Declaration of Identifier, definition of ClassIdentifier<T>; used to identify the class of an object...
Iterator< BaseObject > objectIterator_
The current object of the iterator.
Definition: ClassTreeMask.h:302
The DistanceTrigger is in exclude-mode.
BaseObject * operator*() const
Returns the object the ClassTreeMaskObjectIterator currently points at.
Definition: ClassTreeMask.h:293
std::stack< std::pair< std::list< ClassTreeMaskNode * >::iterator, std::list< ClassTreeMaskNode * >::iterator > > nodes_
A stack to store list-iterators.
Definition: ClassTreeMask.h:159
The ClassTreeMaskIterator moves through all ClassTreeMaskNodes of the internal tree of a ClassTreeMas...
Definition: ClassTreeMask.h:145
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
BaseObject * operator->() const
Returns the object the ClassTreeMaskObjectIterator currently points at.
Definition: ClassTreeMask.h:295
#define _CoreExport
Definition: CorePrereqs.h:61
std::ostream & operator<<(std::ostream &out, const std::set< const Identifier * > &list)
Lists the names of all Identifiers in a std::set<const Identifier*>.
Definition: Identifier.cc:466
The Identifier is used to identify the class of an object and to store information about the class...
Definition: Identifier.h:109
std::list< ClassTreeMaskNode * > subnodes_
A list containing all subnodes of this node.
Definition: ClassTreeMask.h:122
Declaration of BaseObject, the base class of all objects in Orxonox.
BaseObject * end() const
End of the ClassTreeMaskObjectIterator.
Definition: ClassTreeMask.h:213
bool bIncluded_
The rule: included or excluded.
Definition: ClassTreeMask.h:121
Definition of the Iterator class, used to iterate through object-lists.
const Identifier * getClass() const
Returns the Identifier of the class the rule refers to.
Definition: ClassTreeMask.h:112
bool isExcluded() const
Tells if the rule is "excluded" or not.
Definition: ClassTreeMask.h:109
std::list< std::pair< const Identifier *, bool > >::iterator subclassIterator_
The current class of the iterator.
Definition: ClassTreeMask.h:301
const ClassTreeMask & begin() const
Begin of the ClassTreeMaskObjectIterator.
Definition: ClassTreeMask.h:211
bool hasSubnodes() const
Returns true if the node has some subnodes.
Definition: ClassTreeMask.h:115
constexpr bool operator==(bool x, tribool y)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: tribool.h:117
The ClassTreeMaskObjectIterator iterates through all objects of the classes that were included by a C...
Definition: ClassTreeMask.h:274
const Identifier * subclass_
The Identifier of the subclass the rule refers to.
Definition: ClassTreeMask.h:120
The ClassTreeMaskNode is a node in the internal tree of the ClassTreeMask, containing the rules of th...
Definition: ClassTreeMask.h:90
ClassTreeMaskObjectIterator(const ClassTreeMask &mask)
Copy-Constructor: Initializes the iterator from another ClassTreeMask.
Definition: ClassTreeMask.h:280
std::list< std::pair< const Identifier *, bool > > subclasses_
A list of all Identifiers through which objects the iterator should iterate.
Definition: ClassTreeMask.h:300
InputManager::State operator&=(InputManager::State &lval, int rval)
Defines the &= operator for easier use.
Definition: InputManager.cc:82