descriptor.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // 
00005 
00006 #ifndef BALL_QSAR_DESCRIPTOR_H
00007 #define BALL_QSAR_DESCRIPTOR_H
00008 
00009 #ifndef BALL_CONCEPT_PROCESSOR_H
00010 # include <BALL/CONCEPT/processor.h>
00011 #endif
00012 
00013 #ifndef BALL_KERNEL_ATOMCONTAINER_H
00014   #include <BALL/KERNEL/atomContainer.h>
00015 #endif
00016 
00017 namespace BALL
00018 {
00019 
00020   template <typename Key, typename Value> class HashMap;
00021 
00025   class BALL_EXPORT Descriptor
00026     : public UnaryProcessor<AtomContainer>
00027   {
00028     public:
00029     
00030     BALL_CREATE(Descriptor)
00031 
00032     
00037     Descriptor();
00038     
00041     Descriptor(const Descriptor& descriptor);
00042 
00045     Descriptor(const String& name);
00046     
00049     Descriptor(const String& name, const String& unit);
00050     
00053     virtual ~Descriptor();
00055 
00061     Descriptor& operator = (const Descriptor& descriptor);
00063 
00067     Processor::Result operator () (AtomContainer& ac);
00069 
00073     /*_ This getter resturns the name of the descriptor as
00074         a string reference
00075     */
00076     const String& getName() const;
00077 
00078     /*_ This setter sets the name of a descriptor
00079         @param name as string
00080     */
00081     void setName(const String& name);   
00082 
00083     /*_ Setter, to set the unit of a descriptor
00084         @param unit as string
00085     */
00086     void setUnit(const String& name);
00087 
00088     /*_ Getter, returns the unit of the descriptor
00089         as a string reference
00090     */
00091     const String& getUnit() const;
00092 
00093     /*_ Generic compute method
00094     */
00095     virtual double compute(AtomContainer& ac);
00097     
00098     
00099     protected:
00100     
00101     /*_ Generic calculate function
00102     */
00103     virtual void calculate_(AtomContainer& ac);
00104 
00108     /*_ Predicate which returns true if the descriptor
00109         data is calculated and valid.     
00110     */
00111     virtual bool isValid_(AtomContainer& ac);
00113     
00114 
00115     private:
00116 
00117     //static HashMap<Handle, PreciseTime> mod_times_;
00118 
00119     /*_ String which saves the name of the descriptor
00120     */
00121     String  name_;
00122     
00123     /*_ String which saves the unit of the values
00124         from the descriptor
00125     */
00126     String  unit_;
00127   };
00128 } // namespace BALL
00129 
00130 #endif // BALL_QSAR_DESCRIPTOR_H
00131