Marsyas
0.6.0-alpha
|
00001 /* 00002 ** Copyright (C) 1998-2005 George Tzanetakis <gtzan@cs.uvic.ca> 00003 ** 00004 ** This program is free software; you can redistribute it and/or modify 00005 ** it under the terms of the GNU General Public License as published by 00006 ** the Free Software Foundation; either version 2 of the License, or 00007 ** (at your option) any later version. 00008 ** 00009 ** This program is distributed in the hope that it will be useful, 00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 ** GNU General Public License for more details. 00013 ** 00014 ** You should have received a copy of the GNU General Public License 00015 ** along with this program; if not, write to the Free Software 00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00019 #ifndef MARSYAS_COLLECTION_H 00020 #define MARSYAS_COLLECTION_H 00021 00022 #include <string> 00023 #include <vector> 00024 #include <iostream> 00025 #include <fstream> 00026 #include <sstream> 00027 #include <marsyas/common_header.h> 00028 00029 namespace Marsyas 00030 { 00039 class marsyas_EXPORT Collection 00040 { 00041 private: 00042 std::vector<std::string> collectionList_; 00043 std::vector<std::string> labelList_; 00044 std::vector<std::string> labelNames_; 00045 std::string name_; 00046 bool hasLabels_; 00047 bool store_labels_; 00048 00049 public: 00050 Collection(); 00051 ~Collection(); 00052 mrs_natural size(); 00053 void setName(std::string name); 00054 std::string entry(mrs_natural i); 00055 std::string labelEntry(mrs_natural i); 00056 mrs_natural getSize(); 00057 mrs_natural getNumLabels(); 00058 mrs_string getLabelNames(); 00059 mrs_natural labelNum(mrs_string label); 00060 mrs_string labelName(mrs_natural i); 00061 mrs_bool hasLabels(); 00062 void add(std::string entry); 00063 void add(std::string entry, std::string label); 00064 std::string name(); 00065 void shuffle(); 00066 void read(std::string filename); 00067 void write(std::string filename); 00068 void labelAll(std::string label); 00069 std::string toLongString(); 00070 void concatenate(std::vector<Collection> cls); 00071 void clear(); 00072 void store_labels(mrs_bool store); 00073 mrs_real regression_label(mrs_natural cindex); 00074 00075 marsyas_EXPORT friend std::ostream& operator<<(std::ostream&, const Collection&); 00076 marsyas_EXPORT friend std::istream& operator>>(std::istream&, Collection&); 00077 }; 00078 00079 }//namespace Marsyas 00080 00081 #endif