Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #if !defined(ALIZE_FeatureServer_h)
00056 #define ALIZE_FeatureServer_h
00057
00058 #if defined(_WIN32)
00059 #if defined(ALIZE_EXPORTS)
00060 #define ALIZE_API __declspec(dllexport)
00061 #else
00062 #define ALIZE_API __declspec(dllimport)
00063 #endif
00064 #else
00065 #define ALIZE_API
00066 #endif
00067
00068 #include "FeatureInputStream.h"
00069 #include "RefVector.h"
00070
00071 namespace alize
00072 {
00073 class Config;
00074 class XLine;
00075
00094 class ALIZE_API FeatureServer : public FeatureInputStream
00095 {
00096 friend class TestFeatureServer;
00097 public :
00098
00101 explicit FeatureServer();
00102
00106 explicit FeatureServer(const Config& c);
00107
00113 explicit FeatureServer(const Config& c, FeatureInputStream& s);
00114
00120 explicit FeatureServer(const Config& c, const FileName& f);
00121
00128 explicit FeatureServer(const Config& c, const FileName& f,
00129 LabelServer& ls);
00137 explicit FeatureServer(const Config& c, const XLine& l);
00138
00147 explicit FeatureServer(const Config& c, const XLine& l,
00148 LabelServer& ls);
00152 void init(const Config& c);
00153
00159 void init(const Config& c, FeatureInputStream& s);
00160
00167 void init(const Config& c, const FileName& f);
00168
00175 void init(const Config& c, const FileName& f, LabelServer& ls);
00176
00185 void init(const Config& c, const XLine& l);
00186
00195 void init(const Config& c, const XLine& l, LabelServer& ls);
00196
00197 virtual ~FeatureServer();
00198
00203
00205 virtual unsigned long getFeatureCount();
00206
00210 virtual unsigned long getVectSize();
00211
00215 virtual const FeatureFlags& getFeatureFlags();
00216
00220 virtual real_t getSampleRate();
00221
00222 const String& getServerName() const;
00223 void setServerName(const String& s);
00224
00232 virtual bool readFeature(Feature& f, unsigned long s = 1);
00233
00239 virtual bool writeFeature(const Feature& f, unsigned long s = 1);
00240
00245 virtual void seekFeature(unsigned long n, const String& s = "");
00246
00251 virtual void reset();
00252
00255 virtual void close();
00256
00260 virtual unsigned long getSourceCount();
00261
00266 virtual unsigned long getFeatureCountOfASource(unsigned long srcIdx);
00267
00272 virtual unsigned long getFeatureCountOfASource(const String& src);
00273
00279 virtual unsigned long getFirstFeatureIndexOfASource(unsigned long srcIdx);
00280
00286 virtual unsigned long getFirstFeatureIndexOfASource(const String& srcName);
00287
00293 virtual const String& getNameOfASource(unsigned long srcIdx);
00294
00295 virtual String getClassName() const;
00296 virtual String toString() const;
00297
00298 private :
00299
00300 bool _ownInputStream;
00301 FeatureInputStream* _pInputStream;
00302 String _serverName;
00303
00304 FeatureInputStream& inputStream();
00305 void init();
00306 HistoricUsage defineHistoricUsage() const;
00307 unsigned long defineHistoricSize() const;
00308 BufferUsage defineBufferUsage() const;
00309 unsigned long defineBufferSize() const;
00310 void releaseAll();
00311 FeatureServer(const FeatureServer& s);
00312 bool operator==(const FeatureServer&);
00313 bool operator!=(const FeatureServer&);
00314 const FeatureServer& operator=(
00315 const FeatureServer&);
00316 };
00317
00318 }
00319
00320 #endif // !defined(ALIZE_FeatureServer_h)
00321