Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Selector Class Reference
[Kernel Predicates]

Atom Selection from Regular Expression. More...

#include <selector.h>

Inheritance diagram for Selector:

UnaryProcessor< Composite > UnaryFunctor< Composite, Processor::Result > List of all members.

Public Member Functions

Constructors and Destructors
 Selector () throw ()
 Default constructor.
 Selector (const Selector &selector) throw ()
 Copy constructor.
 Selector (const String &expression_string) throw ()
 Construct a Selector with a string.
virtual ~Selector () throw ()
 Destructor.
Assignment
virtual void clear () throw ()
 Clear method.
Selectoroperator= (const Selector &selector) throw ()
 Assignment operator.
Predicates
bool operator== (const Selector &selector) const throw ()
 Equality.
Processor related methods
virtual Processor::Result operator() (Composite &composite) throw ()
 Access operator.
virtual bool start () throw ()
 Processor start method.
Accessors
Size getNumberOfSelectedAtoms () const throw ()
 Return the number of atoms selected during the last application.
List< Atom * > & getSelectedAtoms () throw ()
 Return a list containing pointers to all selected Atoms.
void setExpression (const Expression &expression) throw ()
 Define the expression.
const ExpressiongetExpression () const throw ()
 Return the expression.

Protected Attributes

List< Atom * > selected_atoms_
Expression expression_

Detailed Description

Atom Selection from Regular Expression.


Constructor & Destructor Documentation

Selector::Selector  )  throw ()
 

Default constructor.

Selector::Selector const Selector selector  )  throw ()
 

Copy constructor.

Selector::Selector const String expression_string  )  throw ()
 

Construct a Selector with a string.

The selector's expression is set to expression_string.

virtual Selector::~Selector  )  throw () [virtual]
 

Destructor.


Member Function Documentation

virtual void Selector::clear  )  throw () [virtual]
 

Clear method.

const Expression& Selector::getExpression  )  const throw ()
 

Return the expression.

Size Selector::getNumberOfSelectedAtoms  )  const throw ()
 

Return the number of atoms selected during the last application.

virtual Processor::Result Selector::operator() Composite composite  )  throw () [virtual]
 

Access operator.

If the given Composite is an Atom and the current expression_ is fulfilled for that atom, select it by calling Composite::select .

Reimplemented from UnaryProcessor< Composite >.

Selector& Selector::operator= const Selector selector  )  throw ()
 

Assignment operator.

bool Selector::operator== const Selector selector  )  const throw ()
 

Equality.

void Selector::setExpression const Expression expression  )  throw ()
 

Define the expression.

virtual bool Selector::start  )  throw () [virtual]
 

Processor start method.

This method is needed to reset the internal counter for the number of selected atoms.

Reimplemented from UnaryProcessor< Composite >.