lib/RingBuffer.hh
00001 // 繝ェ繝ウ繧ー繝舌ャ繝輔ぃ繧ッ繝ゥ繧ケ
00002 // 2011/02/14 Yuki YOKOKURA
00003 //
00004 // 繝ェ繝ウ繧ー繝舌ャ繝輔ぃ
00005 //
00006 // Copyright (C) 2011 Yuki YOKOKURA
00007 // This program is free software;
00008 // you can redistribute it and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 3 of the License, or any later version.
00010 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00011 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012 // See the GNU General Public License for more details <http://www.gnu.org/licenses/>.
00013 // Besides, you can negotiate about other options of licenses instead of GPL.
00014 // If you would like to get other licenses, please contact us<yuki@katsura.sd.keio.ac.jp>.
00015 
00016 #ifndef RINGBUFFER
00017 #define RINGBUFFER
00018 
00019 namespace ARCS {        // ARCS蜷榊燕遨コ髢�
00020         class RingBuffer {
00021                 private:
00022                         RingBuffer(const RingBuffer&);                                  // 繧ウ繝斐�シ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ菴ソ逕ィ遖∵ュ「
00023                         const RingBuffer& operator=(const RingBuffer&); // 莉」蜈・貍皮ョ怜ュ蝉スソ逕ィ遖∵ュ「
00024                         unsigned long N;        // 繝ェ繝ウ繧ー繝舌ャ繝輔ぃ縺ョ螟ァ縺阪&
00025                         unsigned long i;        // 繝ェ繝ウ繧ー繝舌ャ繝輔ぃ繧ォ繧ヲ繝ウ繧ソ
00026                         double* Buffer; // 繝ェ繝ウ繧ー繝舌ャ繝輔ぃ
00027                 
00028                 public:
00029                         RingBuffer(unsigned long Length);       // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ Length�シ帙Μ繝ウ繧ー繝舌ャ繝輔ぃ縺ョ螟ァ縺阪&
00030                         ~RingBuffer();                                          // 繝�繧ケ繝医Λ繧ッ繧ソ
00031                         void PutValue(double u);                        // 蛟、繧偵ヰ繝�繝輔ぃ縺ォ譬シ邏�(蜷梧凾縺ォ繝舌ャ繝輔ぃ縺ョ繧ォ繧ヲ繝ウ繧ソ縺悟「怜刈) u�シ帛�・蜉帛�、
00032                         double GetValue(void);                          // 繝舌ャ繝輔ぃ縺九i譛�蠕悟ーセ縺ョ蛟、繧貞叙繧雁�コ縺� 謌サ繧雁�、�シ帛�コ蜉帛�、
00033                         double* GetPointer(void);                       // 繝舌ャ繝輔ぃ縺ク縺ョ繝昴う繝ウ繧ソ繧定ソ斐☆
00034                         void SetCounter(unsigned long j);       // 繧ォ繧ヲ繝ウ繧ソ繧剃ササ諢丞�、縺ォ險ュ螳� j�シ帑ササ諢上�ョ繧ォ繧ヲ繝ウ繝亥�、
00035                         void ResetCounter(void);                        // 繧ォ繧ヲ繝ウ繧ソ繝ェ繧サ繝�繝�
00036                         void ClearBuffer(void);                         // 繝舌ャ繝輔ぃ縺ョ繧シ繝ュ繧ッ繝ェ繧「
00037         };
00038 }
00039 
00040 #endif
00041 
00042 
00043 
 All Classes Files