Property list. More...
#include <SgProp.h>
Public Member Functions | |
SgPropList () | |
~SgPropList () | |
bool | IsEmpty () const |
Return whether this list contains zero elements. | |
void | Clear () |
Remove all elements in this list, disposing each property. | |
SgProp * | Get (SgPropID id) const |
Return the first property in the list that matches the given ID. | |
SgProp * | GetPropContainingText (const std::string &findText) const |
Return the first property in the list that matches the given text. | |
void | Add (const SgProp *prop) |
Add the property to this property list. | |
void | MoveToFront (SgPropID id) |
If the property with the given ID exists, move it to the front of this property list. | |
bool | Remove (const SgProp *prop) |
Remove the property from the property list. | |
void | Remove (SgPropID id, const SgProp *protectProp) |
Remove any properties that match 'id' from this list, and dispose them, except don't touch *protectProp if it's in the list. | |
void | RemoveProp (SgPropID id) |
bool | AppendMoveAnnotation (std::string *s) const |
Add the move annotations at the end of '*string'. | |
Private Member Functions | |
SgPropList (const SgPropList &) | |
not implemented | |
SgPropList & | operator= (const SgPropList &) |
not implemented | |
Private Attributes | |
SgVectorOf< SgProp > | m_list |
property list implemented as list of properties | |
Friends | |
class | SgPropListIterator |
Property list.
Implemented as list of pointers to objects derived from Property.
Definition at line 127 of file SgProp.h.
SgPropList::SgPropList | ( | ) |
Definition at line 141 of file SgProp.cpp.
SgPropList::~SgPropList | ( | ) |
Definition at line 145 of file SgProp.cpp.
References Clear().
SgPropList::SgPropList | ( | const SgPropList & | ) | [private] |
not implemented
void SgPropList::Add | ( | const SgProp * | prop | ) |
Add the property to this property list.
Enforces that no two properties of the same kind are added.
Definition at line 168 of file SgProp.cpp.
References SgProp::Flag(), SgProp::ID(), SgVectorOf< T >::Include(), m_list, Remove(), SG_ASSERT, SG_PROP_MOVE, SG_PROP_MOVE_ANNO, SG_PROP_POS_ANNO, SG_PROP_UNKNOWN, SG_PROPCLASS_ANNO_MOVE, SG_PROPCLASS_ANNO_POS, and SG_PROPCLASS_MOVE.
Referenced by SgNode::Add().
bool SgPropList::AppendMoveAnnotation | ( | std::string * | s | ) | const |
Add the move annotations at the end of '*string'.
!! very good move SG_PROP_GOOD_MOVE[2]
! good move SG_PROP_GOOD_MOVE[1]
!? interesting move SG_PROP_INTERESTING
?! doubtful move SG_PROP_DOUBTFUL
? bad move SG_PROP_BAD_MOVE[1]
?? very bad move SG_PROP_BAD_MOVE[2]
Return true if a move annotation was added.
Definition at line 219 of file SgProp.cpp.
References Get(), SgProp::ID(), SG_PROP_BAD_MOVE, SG_PROP_DOUBTFUL, SG_PROP_GOOD_MOVE, SG_PROP_INTERESTING, SG_PROP_MOVE_ANNO, and SgPropInt::Value().
void SgPropList::Clear | ( | ) |
Remove all elements in this list, disposing each property.
Definition at line 150 of file SgProp.cpp.
References SgVector< T >::Clear(), and m_list.
Referenced by ~SgPropList().
Return the first property in the list that matches the given ID.
Note that SG_PROP_INFO, SG_PROP_ANNOTATE, SG_PROP_POS_ANNO, SG_PROP_MOVE_ANNO, and SG_PROP_COUNT match any property that has the corresponding flag set.
Definition at line 157 of file SgProp.cpp.
References m_list, and SgProp::MatchesID().
Referenced by AppendMoveAnnotation(), SgNode::Get(), and MoveToFront().
SgProp * SgPropList::GetPropContainingText | ( | const std::string & | findText | ) | const |
Return the first property in the list that matches the given text.
Definition at line 238 of file SgProp.cpp.
References SgProp::ContainsText(), and m_list.
Referenced by SgNode::ContainsText().
bool SgPropList::IsEmpty | ( | ) | const |
Return whether this list contains zero elements.
Definition at line 192 of file SgProp.h.
References SgVector< T >::IsEmpty(), and m_list.
void SgPropList::MoveToFront | ( | SgPropID | id | ) |
If the property with the given ID exists, move it to the front of this property list.
Definition at line 189 of file SgProp.cpp.
References SgVectorOf< T >::Exclude(), Get(), m_list, and SgVectorOf< T >::PushFront().
SgPropList& SgPropList::operator= | ( | const SgPropList & | ) | [private] |
not implemented
Remove any properties that match 'id' from this list, and dispose them, except don't touch *protectProp if it's in the list.
Definition at line 203 of file SgProp.cpp.
References SgVectorOf< T >::Exclude(), m_list, SgProp::MatchesID(), and SgVectorOf< T >::PushBack().
bool SgPropList::Remove | ( | const SgProp * | prop | ) |
Remove the property from the property list.
Return true if the property was in the list.
Definition at line 196 of file SgProp.cpp.
References SgVectorOf< T >::Exclude(), and m_list.
Referenced by Add(), and RemoveProp().
void SgPropList::RemoveProp | ( | SgPropID | id | ) |
Definition at line 167 of file SgProp.h.
References Remove().
Referenced by SgNodeUtil::RemovePropInSubtree().
friend class SgPropListIterator [friend] |
SgVectorOf<SgProp> SgPropList::m_list [private] |
property list implemented as list of properties
Definition at line 183 of file SgProp.h.
Referenced by Add(), Clear(), Get(), GetPropContainingText(), IsEmpty(), MoveToFront(), and Remove().