$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_FirmwareSequence_h 00002 #define _ots_FirmwareSequence_h 00003 00004 #include <vector> 00005 00006 namespace ots 00007 { 00008 template<typename T> 00009 class FirmwareSequence 00010 { 00011 public: 00012 typedef std::vector<std::pair<T, std::vector<T> > > Sequence; // It is a vector of 00013 // pairs of addresses 00014 // and data to send to 00015 // the Firmware 00016 typedef typename Sequence::iterator iterator; 00017 typedef typename Sequence::const_iterator const_iterator; 00018 00019 FirmwareSequence(void) { ; } 00020 virtual ~FirmwareSequence(void) { ; } 00021 00022 // Getters 00023 const Sequence& getSequence(void) const { return theSequence_; } 00024 00025 inline void pushBack(std::pair<T, std::vector<T> > entry) 00026 { 00027 theSequence_.push_back(entry); 00028 } 00029 inline void pushBack(T address, const std::vector<T>& data) 00030 { 00031 theSequence_.push_back(std::pair<T, std::vector<T> >(address, data)); 00032 } 00033 inline void pushBack(T address, const T& data) 00034 { 00035 theSequence_.push_back( 00036 std::pair<T, std::vector<T> >(address, std::vector<T>(1, data))); 00037 } 00038 void clear(void) { theSequence_.clear(); } 00039 00040 iterator begin(void) { return theSequence_.begin(); } 00041 iterator end(void) { return theSequence_.end(); } 00042 00043 const const_iterator begin(void) const { return theSequence_.begin(); } 00044 const const_iterator end(void) const { return theSequence_.end(); } 00045 00046 private: 00047 Sequence theSequence_; 00048 }; 00049 } 00050 00051 #endif