| Line |  | 
|---|
| 1 | // This may look like C code, but it is really -*- C++ -*- | 
|---|
| 2 |  | 
|---|
| 3 | // ArchTOIPipe           (C)     CEA/DAPNIA/SPP IN2P3/LAL | 
|---|
| 4 | //                               Eric Aubourg | 
|---|
| 5 | //                               Christophe Magneville | 
|---|
| 6 | //                               Reza Ansari | 
|---|
| 7 | // $Id: ringphase.h,v 1.1 2003-05-19 23:31:29 aubourg Exp $ | 
|---|
| 8 |  | 
|---|
| 9 | #ifndef RINGPHASE_H | 
|---|
| 10 | #define RINGPHASE_H | 
|---|
| 11 |  | 
|---|
| 12 | #include "config.h" | 
|---|
| 13 | using namespace std; | 
|---|
| 14 |  | 
|---|
| 15 | #ifdef WITH_SOPHYA | 
|---|
| 16 | #include "array.h" | 
|---|
| 17 | #include "pexceptions.h" | 
|---|
| 18 | using namespace SOPHYA; | 
|---|
| 19 | #else | 
|---|
| 20 | #include "apexceptions.h" | 
|---|
| 21 | #endif | 
|---|
| 22 |  | 
|---|
| 23 | class RingPhase { | 
|---|
| 24 | public: | 
|---|
| 25 | virtual ~RingPhase() {}; | 
|---|
| 26 |  | 
|---|
| 27 | virtual int getNSamples() const = 0; | 
|---|
| 28 | virtual double getPhase(int i) const = 0; | 
|---|
| 29 |  | 
|---|
| 30 | }; | 
|---|
| 31 |  | 
|---|
| 32 | class SimpleRingPhase : public RingPhase { | 
|---|
| 33 | public: | 
|---|
| 34 | SimpleRingPhase(int nsamples) : n(nsamples) {} | 
|---|
| 35 |  | 
|---|
| 36 | int getNSamples() const {return n;} | 
|---|
| 37 | double getPhase(int i) const {return (double)i / n;} | 
|---|
| 38 |  | 
|---|
| 39 | protected: | 
|---|
| 40 | int n; | 
|---|
| 41 | }; | 
|---|
| 42 |  | 
|---|
| 43 | #endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.