00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _ots_RegisterView_h_
00009 #define _ots_RegisterView_h_
00010 #include "otsdaq-core/MessageFacility/MessageFacility.h"
00011 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
00012 #include "otsdaq-core/ConfigurationDataFormats/ViewRegisterInfo.h"
00013 #include "otsdaq-core/ConfigurationDataFormats/ViewRegisterSequencerInfo.h"
00014
00015 #include <string>
00016 #include <typeinfo>
00017 #include <iostream>
00018 #include <sstream>
00019 #include <vector>
00020 #include <cassert>
00021 #include <stdlib.h>
00022 namespace ots {
00023
00024 class RegisterView {
00025 public:
00026
00027 typedef std::vector<std::vector<std::string> > DataView;
00028 typedef DataView::iterator iterator;
00029 typedef DataView::const_iterator const_iterator;
00030
00031 RegisterView(std::string name = "");
00032 virtual ~RegisterView();
00033
00034
00035 unsigned int findRow(unsigned int col, const std::string value) const;
00036 unsigned int findRow(unsigned int col, const unsigned int value) const;
00037
00038
00039 std::string getName () const;
00040 int getVersion () const;
00041 std::string getComment () const;
00042 std::string getAuthor () const;
00043 time_t getCreationTime () const;
00044 unsigned int getNumberOfRows () const;
00045 unsigned int getNumberOfColumns () const;
00046 const std::vector<ViewRegisterInfo>& getRegistersInfo () const;
00047 std::vector<ViewRegisterInfo>* getRegistersInfoPointer ();
00048 const std::vector<ViewRegisterSequencerInfo>& getRegistersSequencerInfo () const;
00049 std::vector<ViewRegisterSequencerInfo>* getRegistersSequencerInfoPointer();
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 void setName (std::string name );
00086 void setVersion (int version);
00087 void setVersion (char* version);
00088 void setComment (std::string name );
00089 void setAuthor (std::string name );
00090 void setCreationTime (time_t t );
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 int addRow();
00124 bool deleteRow(int r);
00125
00126 private:
00127 std::string name_ ;
00128 int version_ ;
00129 std::string comment_ ;
00130 std::string author_ ;
00131 time_t creationTime_ ;
00132 std::vector<ViewRegisterInfo> registersInfo_ ;
00133 std::vector<ViewRegisterSequencerInfo> registersSequencerInfo_ ;
00134 DataView theDataView_ ;
00135
00136 };
00137
00138 }
00139
00140 #endif