00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef STORETRANSLATOR
00030 #define STORETRANSLATOR 1
00031
00032
00033
00034
00035
00036
00037 #include "Translator.h"
00038 #include <string>
00039 #include <iostream>
00040 #include <map>
00041
00042 #include "DataXML/DataObject.h"
00043 #include "DataXML/XMLStream.h"
00044
00045
00046 namespace AIDA {
00047 class IHistogram1D;
00048 class IHistogram2D;
00049 class IHistogram3D;
00050 class IProfile1D;
00051 class IProfile2D;
00052 class ICloud1D;
00053 class ICloud2D;
00054 class ICloud3D;
00055 class IDataPointSet;
00056 class IFunction;
00057 class ITuple;
00058 }
00059
00060
00061 namespace Anaphe {
00062 namespace AIDA_XMLStore {
00063
00064
00065 class StoreTranslator : public Translator {
00066
00067 public:
00068
00069
00070
00071
00072 StoreTranslator(std::istream & stream);
00073 StoreTranslator(std::ostream & stream);
00074 virtual ~StoreTranslator();
00075
00076 private:
00077
00078 StoreTranslator(const StoreTranslator &);
00079 StoreTranslator & operator = (const StoreTranslator &);
00080
00081 public:
00082
00084 bool read(DataXML::DataObject & aidaElement);
00086 bool write();
00088 bool append(const AIDA::IHistogram1D & h, const std::string & name, const std::string & path);
00089 bool append(const AIDA::IHistogram2D & h, const std::string & name, const std::string & path);
00090 bool append(const AIDA::IHistogram3D & h, const std::string & name, const std::string & path);
00091 bool append(const AIDA::IProfile1D & p, const std::string & name, const std::string & path);
00092 bool append(const AIDA::IProfile2D & p, const std::string & name, const std::string & path);
00093 bool append(const AIDA::ICloud1D & c, const std::string & name, const std::string & path);
00094 bool append(const AIDA::ICloud2D & c, const std::string & name, const std::string & path);
00095 bool append(const AIDA::ICloud3D & c, const std::string & name, const std::string & path);
00096 bool append(const AIDA::IDataPointSet & dps, const std::string & name, const std::string & path);
00097 bool append(const AIDA::IFunction & f, const std::string & name, const std::string & path);
00098 bool append(AIDA::ITuple & t, const std::string & name, const std::string & path);
00099
00100
00101 DataXML::DataObject & rootElement() { return m_element; }
00102
00103 protected:
00104
00105
00106 private:
00107
00109 void writeFileHeader(std::ostream & stream) const;
00110
00111
00113
00115 DataXML::DataObject m_element;
00117 DataXML::InputXMLStream * m_inputStream;
00119 DataXML::OutputXMLStream * m_outputStream;
00120
00121 };
00122
00123 }
00124 }
00125
00126 #endif
00127
00128
00129
00130
00131