Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Member Functions | Private Attributes | Friends

SgPropList Class Reference

Property list. More...

#include <SgProp.h>

List of all members.

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.
SgPropGet (SgPropID id) const
 Return the first property in the list that matches the given ID.
SgPropGetPropContainingText (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
SgPropListoperator= (const SgPropList &)
 not implemented

Private Attributes

SgVectorOf< SgPropm_list
 property list implemented as list of properties

Friends

class SgPropListIterator

Detailed Description

Property list.

Implemented as list of pointers to objects derived from Property.

Definition at line 127 of file SgProp.h.


Constructor & Destructor Documentation

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


Member Function Documentation

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().

SgProp * SgPropList::Get ( SgPropID  id  )  const

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.

Returns:
0 if there is no such property.

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

void SgPropList::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.

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().


Friends And Related Function Documentation

friend class SgPropListIterator [friend]

Definition at line 180 of file SgProp.h.


Member Data Documentation

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().


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


Sun Mar 13 2011 Doxygen 1.7.1