www.pudn.com > firev0.01.rar > genericfeature.hpp


/*
This file is part of the FIRE -- Flexible Image Retrieval System

FIRE 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.

FIRE 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 FIRE; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * @file   genericfeature.hpp
 * @author Thomas Deselaers
 * @date   Tue Jun 24 19:22:28 2003
 * 
 * @brief very simple class inherited from basefeature just to contain
 * some data.
 * 
 */

#ifndef __genericfeature_hpp
#define __genericfeature_hpp

#include 
#include "basefeature.hpp"
#include 
#include 
#include 
#include "gzstream.hpp"

template
class GenericFeature : public BaseFeature {

public:  
  GenericFeature(int i=10) {
    data=::std::vector(i,0);
  }
  
  GenericFeature(const ::std::vector  in) {
    data=in;
  }

  GenericFeature(const GenericFeature& in) {
    data=::std::vector(in.size());
    for(unsigned int i=0;i> keyword;
      if(!ifs.eof()) {
        if(keyword=="#") {
          char devnull[1024];
          ifs.getline(devnull,1024);
        } else if( keyword=="dim") {
          int dim;
          ifs >> dim;
          data=::std::vector(dim);
        } else if( keyword=="vec" || keyword=="data") {
          for(unsigned int i=0;i> data[i];
          }
        }
      }
    }
    ifs.close();
//     cout << "dim=" << data.size() << " ";
//     for(int i=0;i data;
};

#endif