/[marvin]/marvin/src/libsip/signal.hh
ViewVC logotype

Diff of /marvin/src/libsip/signal.hh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by hannibal, Wed Aug 13 10:01:12 2003 UTC revision 1.2 by vishnou, Tue Aug 26 15:01:54 2003 UTC
# Line 38  Line 38 
38  * E-mail :  * E-mail :
39  *  *
40  *******************************************************************/  *******************************************************************/
41    
42    /**
43     ** \file signal.hh
44     ** Define the signal abstract class
45     */
46    
47    
48  #ifndef SIGNAL_HH  #ifndef SIGNAL_HH
49  #define SIGNAL_HH  #define SIGNAL_HH
50    
51  #include <unistd.h>  #include <unistd.h>
52    #include <assert.h>
53    #include <stdlib.h>
54  #include "signal.hh"  #include "signal.hh"
55    
56    /** \brief Abstract a signal
57     **
58     ** \b Example: voice signal inherit of this class
59    */
60    
61  class Signal {  class Signal {
62    // Associations    // Associations
63    // Attributes    // Attributes
64    
65    /** \brief Let Expression kind.
66     **                                                                        
67     ** Specify if the Let Expression has a value (set at type checking).*/
68      
69  protected:  protected:
70    double *_data;    double *_data;
71    int   _length;    int   _length;
72  public:  public:
73    // Constructeur    // Constructeur
74      /** \name Ctor & dtor.                                                      
75       ** \{ */
76    
77      /** \brief Construct an empty signal
78       */
79    Signal::Signal();    Signal::Signal();
80      /** \brief Construct an empty signal
81       ** \param location scanner position informations                          
82       */
83    Signal::Signal(double *data);    Signal::Signal(double *data);
84      /** \brief Construct a new signal with initialisation
85       ** \param data: data to put in the structure, its a vector of double
86       ** \param length: length of data
87       */
88    Signal::Signal(double *data, int length);    Signal::Signal(double *data, int length);
89     /** \} */
90    
91    
92    // Operations    // Operations
93      /** \name Accessors.                                                        
94       ** \{ */
95    int get_length () { return _length;};    int get_length () { return _length;};
   void set_length (int val) { _length = val;};  
96    double *get_data () { return _data;};    double *get_data () { return _data;};
97      /** \} */
98    
99      /** \name modifior
100       ** \{ */
101      void set_length (int val) { _length = val;};
102    void set_data ( double *data )    void set_data ( double *data )
103    {    {
104      int i;      int i;
# Line 68  public: Line 108  public:
108        _data[i] = data[i];        _data[i] = data[i];
109      _data[i] = '\0';      _data[i] = '\0';
110    }    }
111    double &operator [] ( int valeur );    /** \} */
112    double operator [] ( int valeur ) const;  
113      /** \name overloaded function
114       ** \{ */
115    
116      /** \brief Accessor on data.
117       ** \param the value to get
118       */
119      double &operator [] ( unsigned valeur );
120      double &operator [] ( unsigned valeur ) const;
121      
122      /** \brief equivalent to set data function
123       ** \param a vector of double to assign
124       */
125    void operator = ( double *src );    void operator = ( double *src );
126    
127      /** \brief Compare this to another signal
128       ** \param the other signal
129       */
130    bool operator == ( Signal *src );    bool operator == ( Signal *src );
131      /** \} */
132  };  };
133    
134  #endif  #endif

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26