selector.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: selector.h,v 1.29 2005/10/23 12:02:20 oliver Exp $
00005 //
00006 
00007 #ifndef BALL_KERNEL_SELECTOR_H
00008 #define BALL_KERNEL_SELECTOR_H
00009 
00010 #ifndef BALL_KERNEL_EXPRESSION_H
00011 # include <BALL/KERNEL/expression.h>
00012 #endif
00013 
00014 #ifndef BALL_DATATYPE_LIST_H
00015 # include <BALL/DATATYPE/list.h>
00016 #endif
00017 
00018 
00019 namespace BALL 
00020 {
00021   class Atom;
00022 
00026   class BALL_EXPORT Selector
00027     : public UnaryProcessor<Composite>
00028   {
00029     
00030     public:
00031     
00035 
00036     // BALL_CREATE(Selector)
00037 
00040     Selector();
00041 
00044     Selector(const Selector& selector);
00045 
00049     Selector(const String& expression_string);
00050 
00053     virtual ~Selector();
00054 
00056 
00059 
00062     virtual void clear();
00063 
00066     Selector& operator = (const Selector& selector);
00067 
00069 
00072 
00075     bool operator == (const Selector& selector) const;
00076 
00078 
00081 
00087     virtual Processor::Result operator () (Composite& composite);
00088     
00093     virtual bool start();
00094 
00096 
00099 
00102     Size getNumberOfSelectedAtoms() const;
00103 
00106     List<Atom*>& getSelectedAtoms();
00107     
00110     void setExpression(const Expression& expression);
00111 
00114     const Expression& getExpression() const;
00115     
00116         
00118       
00119     protected:
00120 
00121     List<Atom*> selected_atoms_;
00122     Expression  expression_;
00123   };
00124 
00125 } // namespace BALL
00126 
00127 #endif // BALL_KERNEL_SELECTOR_H