/****************************************************************** * [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 : * *******************************************************************/ #include "signal.hh" #include // Constructeur Signal::Signal() : _data(0), _length(0) { } Signal::Signal(double *data, int length) : _data (data), _length(length) { } double &Signal::operator[] ( unsigned val ) { return _data[val]; } double &Signal::operator[] ( unsigned val ) const { return _data[val]; } bool Signal::operator == ( Signal *src ) { int i; if (!src || !(src->get_data()) || !_data) return false; for (i = 0; (*src)[i] && _data[i] && (*src)[i] == _data[i] ; ++i); if (!((*src)[i]) && _data[i]) return true; return false; }