/****************************************************************** * [LibSip - Signal Processing Library] * Copyright (C) 2002 - 2003 BOUILLET Olivier LEMAIRE Kévin ROUGET Paul * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. This * program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. You should have * received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. * * SPECIAL NOTE (the beerware clause): * This software is free software. However, it also falls under the beerware * special category. That is, if you find this software useful, or use it * every day, or want to grant us for our modest contribution to the * free software community, feel free to send us a beer from one of * your local brewery. Our preference goes to Belgium abbey beers and * irish stout (Guiness for strength!), but we like to try new stuffs. * * Authors: * * BOUILLET Olivier * Paper mail : * E-mail : * * LEMAIRE Kevin * Paper mail : 34 rue Général Lecler 94270 LE KREMLIN BICETRE, FRANCE * E-mail : hannibal@marvinproject.org * * ROUGET Paul * Paper mail : * E-mail : * *******************************************************************/ /** ** \file signal.hh ** Define the signal abstract class */ #ifndef SIGNAL_HH #define SIGNAL_HH /** \brief Abstract a signal ** ** \b Example: voice signal inherit of this class */ class Signal { // Associations // Attributes protected: double *_data; int _length; public: // Constructeur /** \name Ctor & dtor. ** \{ */ /** \brief Construct an empty signal */ Signal::Signal(); /** \brief Construct a new signal with initialisation ** \param data: data to put in the structure, its a vector of double ** \param length: length of data */ Signal::Signal(double *data, int length); /** \} */ // Operations /** \name Accessors. ** \{ */ int get_length () { return _length;}; double *get_data () { return _data;}; /** \} */ /** \name modifior ** \{ */ void set_length (int val) { _length = val;}; void set_data ( double *data ) { int i; if (!data) return ; for (i = 0; data && !data[i]; ++i) _data[i] = data[i]; } /** \} */ /** \name overloaded function ** \{ */ /** \brief Accessor on data. ** \param the value to get */ double &operator [] ( unsigned valeur ); double &operator [] ( unsigned valeur ) const; /** \brief Compare this to another signal ** \param the other signal */ bool operator == ( Signal *src ); /** \} */ }; #endif