Anaphe Home Page Reference Documentation

Main Page     Namespaces     Classes     Source Code    

IAnnotation.h

Go to the documentation of this file.
00001 
00002 #ifndef INTERFACES_IANNOTATION_H
00003 #define INTERFACES_IANNOTATION_H 1
00004 
00005 // Include files
00006 #include <list>
00007 #include <string>
00008 
00009 #if (defined __sun && __SUNPRO_CC > 0x500)
00010 # include <utility>             // that's where CC-5.1 hides the "pair"s ... 
00011 #else
00012 # include <pair.h>
00013 #endif
00014 
00015 
00016 //------------------------------------------------------------------------------
00017 //
00018 // ClassName:    IAnnotation
00019 //  
00020 // Description:  Definition of the IAnnotation interface class
00021 //
00022 //               IAnnotation is a store for information correlated with
00023 //               histograms. It provides a (subset of a) map-like interface
00024 //               for storing and retrieving key/value (string/string) pairs.
00025 //
00026 // Design principles :
00027 //
00028 //  1) Only interfaces, basic types, and types from foundation libraries
00029 //     are allowed (STL is currently the only one foundation library)
00030 //     - Uses only int and double as basic types
00031 //     - Internals (classes, enums, or others) of concrete packages
00032 //       do not appear in the interface
00033 //  2) Accessors - XXX() (no getXXX() functions)
00034 //  3) In member function names
00035 //     - in-range bins are not specified explicitly (e.g. sumBinHeights())
00036 //     - ...All... mean all (in-range and extra) bins (e.g. sumAllBinHeights())
00037 //     - ...Extra... mean extra bins (e.g. sumExtraBinHeights())
00038 //
00039 //
00040 // Authors:      Andreas Pfeiffer
00041 // Date:         26/07/2000
00042 //
00043 // last modification: 
00044 //      ap, 03-nov-00 : removed access to full list, introduced access by index instead.
00045 //                      added visibility flag feature ...
00046 //      ap, 16-dec-00 : added std:: stuff
00047 //      ap, 16-jan-01 : removed default arguments
00048 //------------------------------------------------------------------------------
00049 
00050 #ifndef ANAPHE_NO_NAMESPACE
00051 namespace Anaphe {
00052 #endif
00053 
00054   class IAnnotation {
00055 
00056   public:
00057     virtual ~IAnnotation() { /* nop */ }
00058 
00059   public:
00061     virtual int size() const                                      = 0;
00062 
00063 #ifdef AIDA_DONT_USE_STD
00064 
00066     virtual bool add(string key, string value, bool visibility = true) = 0;
00067 
00069     virtual string find(string key) const                 = 0;
00070 
00072     virtual bool visibilityFlag(string key) const         = 0;
00073 
00074     virtual void setVisibility(string key, bool value)    = 0;
00075 
00078 
00082     virtual string key                 (int index) const        = 0;
00083     virtual string value               (int index) const        = 0;
00084     virtual bool visibilityFlag  (int index) const        = 0;
00085 
00087     virtual ostream& toAscii (ostream &os) const          = 0;
00088     virtual istream& fromAscii (istream &is)              = 0;
00089 
00090 #else 
00091 
00093     virtual bool add(std::string key, std::string value, bool visibility = true) = 0;
00094 
00096     virtual std::string find(std::string key) const               = 0;
00097 
00099     virtual bool visibilityFlag(std::string key) const            = 0;
00100 
00101     virtual void setVisibility(std::string key, bool value)       = 0;
00102 
00105 
00109     virtual std::string key            (int index) const        = 0;
00110     virtual std::string value          (int index) const        = 0;
00111     virtual bool        visibilityFlag   (int index) const        = 0;
00112 
00114     virtual std::ostream& toAscii   (std::ostream &os) const      = 0;
00115     virtual std::istream& fromAscii (std::istream &is)            = 0;
00116 
00117 #endif // dont use std
00118 
00119     virtual void reset()                                          = 0;
00120 
00121   };
00122 
00123 #ifndef SWIG
00124 
00125 #ifdef AIDA_DONT_USE_STD
00126   ostream & operator << (ostream &os, const IAnnotation& ann);
00127   istream & operator >> (istream &is,       IAnnotation& ann);
00128 #else 
00129   std::ostream & operator << (std::ostream &os, const IAnnotation& ann);
00130   std::istream & operator >> (std::istream &is,       IAnnotation& ann);
00131 #endif // dont use std
00132 
00133 #endif // ndef swig
00134 
00135 #ifndef ANAPHE_NO_NAMESPACE
00136 }; // end namespace Anaphe
00137 #endif
00138 
00139 #endif    // INTERFACES_IANNOTATION_H


Anaphe documentation generated by Doxygen (www.doxygen.org)