BALL 1.5.0
Loading...
Searching...
No Matches
BALL::Selector Class Reference

#include <BALL/KERNEL/selector.h>

Inheritance diagram for BALL::Selector:
BALL::UnaryProcessor< Composite > BALL::UnaryFunctor< ArgumentType, ResultType >

Public Member Functions

Constructors and Destructors
 Selector ()
 Selector (const Selector &selector)
 Selector (const String &expression_string)
virtual ~Selector ()
Assignment
virtual void clear ()
Selectoroperator= (const Selector &selector)
Predicates
bool operator== (const Selector &selector) const
Processor related methods
virtual Processor::Result operator() (Composite &composite)
virtual bool start ()
Public Member Functions inherited from BALL::UnaryProcessor< Composite >
 UnaryProcessor ()
 UnaryProcessor (const UnaryProcessor &)
virtual ~UnaryProcessor ()
virtual bool finish ()

Accessors

std::list< Atom * > selected_atoms_
Expression expression_
Size getNumberOfSelectedAtoms () const
std::list< Atom * > & getSelectedAtoms ()
void setExpression (const Expression &expression)
const ExpressiongetExpression () const

Additional Inherited Members

Public Types inherited from BALL::UnaryFunctor< ArgumentType, ResultType >
typedef ResultType result_type
typedef ArgumentType argument_type
typedef ArgumentType & argument_reference
typedef const ArgumentType & const_argument_reference
typedef ArgumentType * argument_pointer
typedef const ArgumentType * const_argument_pointer

Detailed Description

Atom Selection from BALL Expression.

This class takes a string that represents an Expression. It can then be applied to a Composite and will select all atoms matching the Expression. Refer to the documentation of Expression for a list of available predicates.
See also
Expression

Definition at line 30 of file selector.h.

Constructor & Destructor Documentation

◆ Selector() [1/3]

BALL::Selector::Selector ( )

Default constructor.

◆ Selector() [2/3]

BALL::Selector::Selector ( const Selector & selector)

Copy constructor.

◆ Selector() [3/3]

BALL::Selector::Selector ( const String & expression_string)

Construct a Selector with a string. The selector's expression is set to expression_string.

◆ ~Selector()

virtual BALL::Selector::~Selector ( )
virtual

Destructor.

Member Function Documentation

◆ clear()

virtual void BALL::Selector::clear ( )
virtual

Clear method.

◆ getExpression()

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

Return the expression.

◆ getNumberOfSelectedAtoms()

Size BALL::Selector::getNumberOfSelectedAtoms ( ) const

Return the number of atoms selected during the last application.

◆ getSelectedAtoms()

std::list< Atom * > & BALL::Selector::getSelectedAtoms ( )

Return a list containing pointers to all selected Atoms

◆ operator()()

virtual Processor::Result BALL::Selector::operator() ( Composite & composite)
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 BALL::UnaryProcessor< Composite >.

◆ operator=()

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

Assignment operator.

◆ operator==()

bool BALL::Selector::operator== ( const Selector & selector) const

Equality.

◆ setExpression()

void BALL::Selector::setExpression ( const Expression & expression)

Define the expression.

◆ start()

virtual bool BALL::Selector::start ( )
virtual

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

Reimplemented from BALL::UnaryProcessor< Composite >.

Member Data Documentation

◆ expression_

Expression BALL::Selector::expression_
protected

Definition at line 126 of file selector.h.

◆ selected_atoms_

std::list<Atom*> BALL::Selector::selected_atoms_
protected

Definition at line 125 of file selector.h.