composedEnergyProcessor.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: composedEnergyProcessor.h,v 1.13 2005/12/23 17:01:43 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_ENERGY_COMPOSEDENERGYPROCESSOR
00008 #define BALL_ENERGY_COMPOSEDENERGYPROCESSOR
00009 
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013 
00014 #ifndef BALL_DATATYPE_LIST_H
00015 # include <BALL/DATATYPE/list.h>
00016 #endif
00017 
00018 #ifndef BALL_ENERGY_ENERGYPROCESSOR_H
00019 # include <BALL/ENERGY/energyProcessor.h>
00020 #endif
00021 
00022 namespace BALL
00023 {
00024   
00028   typedef List<EnergyProcessor*> EnergyProcessorList;
00029 
00038   class BALL_EXPORT ComposedEnergyProcessor
00039     : public EnergyProcessor
00040   {
00041 
00042     public:
00043 
00044     BALL_CREATE(ComposedEnergyProcessor)
00045 
00046     
00049 
00052     ComposedEnergyProcessor();
00053 
00056     ComposedEnergyProcessor(const ComposedEnergyProcessor& composed_energy_proc);
00057 
00060     ComposedEnergyProcessor(EnergyProcessorList proc_list);
00061 
00064     virtual ~ComposedEnergyProcessor();
00065 
00067 
00070 
00073     const ComposedEnergyProcessor& operator = 
00074       (const ComposedEnergyProcessor& proc);
00075 
00079     virtual void clear();
00080   
00082 
00085     
00088     virtual bool finish();
00089 
00091 
00094 
00097     void addComponent(EnergyProcessor* proc);
00098 
00101     void removeComponent(EnergyProcessor* proc);
00102 
00105     Size getNumberOfEnergyProcessors() const;
00106     
00108 
00111 
00114     bool operator == (const ComposedEnergyProcessor& proc) const;
00115 
00117 
00118     protected:
00119 
00120     EnergyProcessorList components_;
00121 
00122 
00123     private:
00124 
00125     /*_ check the validity of this instance. If one of the processors in
00126      * the list is invalid, then this instance of ComposedEnergyProcessor
00127      * is invalid 
00128     */
00129     void checkValidity();
00130 
00131   };
00132 } // namespace BALL
00133 #endif //  BALL_ENERGY_COMPOSEDENERGYPROCESSOR