Annotation.hpp

Go to the documentation of this file.
00001 
00015 #ifndef Annotation_H
00016 #define Annotation_H
00017 
00018 #include <iostream>
00019 #include <string>
00020 #include <OpenAnalysis/Utils/OA_ptr.hpp>
00021 #include <OpenAnalysis/Utils/OutputBuilderText.hpp>
00022 
00023 namespace OA {
00024 
00025 class Annotation {
00026   protected:
00027     // output builder for all annotations
00028     static OA_ptr<OutputBuilder> sOutBuild;
00029 
00030   public:
00031     Annotation() 
00032       { if (sOutBuild.ptrEqual(0)) sOutBuild = new OutputBuilderText; }
00033       // FIXME: this could lead to performance problems but it
00034       // seems the only other option is to have some kind of
00035       // initialization method called before calling any output
00036       // methods or hardcode to a specific OutputBuilder subclass
00037 
00038     virtual ~Annotation() {}
00039 
00040     static void configOutput(OA_ptr<OutputBuilder> ob) { sOutBuild = ob; }
00041 
00042     // methods all annotations must provide
00043     virtual void output(IRHandlesIRInterface& ir) = 0;
00044 };
00045 
00046 } // end of OA namespace
00047 
00048 #endif
00049 

Generated on Sat Oct 31 05:21:20 2009 for OpenAnalysis by  doxygen 1.6.1