File indexing completed on 2024-04-06 11:58:12
0001 #ifndef PixelConfigBase_h
0002 #define PixelConfigBase_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <string>
0018 #include "CalibFormats/SiPixelObjects/interface/PixelConfigKey.h"
0019 #include "CalibFormats/SiPixelObjects/interface/PixelBase64.h"
0020
0021 namespace pos {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 class PixelConfigBase {
0033 public:
0034
0035
0036
0037
0038
0039 PixelConfigBase(std::string description, std::string creator, std::string date);
0040
0041 virtual ~PixelConfigBase() {}
0042
0043 std::string description();
0044 std::string creator();
0045 std::string date();
0046
0047
0048 virtual void writeASCII(std::string dir = "") const = 0;
0049
0050 virtual void writeXMLHeader(pos::PixelConfigKey key,
0051 int version,
0052 std::string path,
0053 std::ofstream *out,
0054 std::ofstream *out1,
0055 std::ofstream *out2) const {
0056 ;
0057 }
0058 virtual void writeXML(std::ofstream *out, std::ofstream *out1, std::ofstream *out2) const { ; }
0059 virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *ou1, std::ofstream *out2) const { ; }
0060 virtual void writeXML(pos::PixelConfigKey key, int version, std::string path) const { ; }
0061 virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const { ; }
0062 virtual void writeXML(std::ofstream *out) const {
0063 std::cout << __LINE__ << " " << __PRETTY_FUNCTION__ << "\tUnimplemented method" << std::endl;
0064 ;
0065 }
0066 virtual void writeXMLTrailer(std::ofstream *out) const { ; }
0067
0068 void setAuthor(std::string author) { creator_ = author; }
0069 void setComment(std::string comment) { comment_ = comment; }
0070 std::string getAuthor() const { return creator_; }
0071 std::string getComment() const { return base64_encode((unsigned char *)comment_.c_str(), comment_.length()); }
0072
0073 private:
0074 std::string description_;
0075 std::string creator_;
0076 std::string date_;
0077 std::string comment_;
0078 };
0079
0080
0081 }
0082
0083 #endif