Stimfit
0.13.15
|
00001 // This program is free software; you can redistribute it and/or 00002 // modify it under the terms of the GNU General Public License 00003 // as published by the Free Software Foundation; either version 2 00004 // of the License, or (at your option) any later version. 00005 00006 // This program is distributed in the hope that it will be useful, 00007 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00008 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00009 // GNU General Public License for more details. 00010 00011 // You should have received a copy of the GNU General Public License 00012 // along with this program; if not, write to the Free Software 00013 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00014 00021 #ifndef _CHANNEL_H 00022 #define _CHANNEL_H 00023 00028 class Section; 00029 00031 class StfioDll Channel { 00032 public: 00033 00034 //ctor/dtor--------------------------------------------------- 00036 explicit Channel(void); 00037 00039 00041 explicit Channel(const Section& c_Section); 00042 00044 00046 explicit Channel(const std::vector<Section>& SectionList); 00047 00049 00055 explicit Channel(std::size_t c_n_sections, std::size_t section_size = 0); 00056 00058 ~Channel(); 00059 00060 //operators--------------------------------------------------- 00061 00063 00067 Section& operator[](std::size_t at_) { return SectionArray[at_]; } 00068 00070 00074 const Section& operator[](std::size_t at_) const { return SectionArray[at_]; } 00075 00076 //member access: read----------------------------------------- 00077 00079 00081 const std::string& GetChannelName() const { return name; } 00082 00084 00086 const std::string& GetYUnits( ) const { return yunits; } 00087 00089 00091 size_t size() const { return SectionArray.size(); } 00092 00094 00098 const Section& at(std::size_t at_) const; 00099 00101 00105 Section& at(std::size_t at_); 00106 00108 00110 const std::vector< Section >& get() const { return SectionArray; } 00111 00112 00114 00116 std::vector< Section >& get() { return SectionArray; } 00117 00118 //member access: write---------------------------------------- 00119 00121 00123 void SetChannelName(const std::string& value) { name = value; } 00124 00126 00128 void SetYUnits( const std::string& value ) { yunits = value; } 00129 00130 //misc-------------------------------------------------------- 00131 00133 00139 void InsertSection(const Section& c_Section, std::size_t pos); 00140 00142 00144 void resize(std::size_t newSize); 00145 00147 00150 void reserve(std::size_t resSize); 00151 00152 private: 00153 //private members--------------------------------------------- 00154 00155 std::string name, yunits; 00156 00157 // An array of sections 00158 std::vector< Section > SectionArray; 00159 00160 }; 00161 00164 #endif 00165