00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef SEMAINE_CMS_SENDER_FEATURESENDER_H
00011 #define SEMAINE_CMS_SENDER_FEATURESENDER_H
00012
00013 #include <semaine/config.h>
00014
00015 #include <cms/CMSException.h>
00016
00017 #include <semaine/cms/sender/Sender.h>
00018 #include <semaine/cms/exceptions/SystemConfigurationException.h>
00019
00020 using namespace cms;
00021 using namespace semaine::cms::sender;
00022 using namespace semaine::cms::exceptions;
00023
00024 namespace semaine {
00025 namespace cms {
00026 namespace sender {
00027
00028 class FeatureSender : public Sender
00029 {
00030 public:
00046 FeatureSender(const std::string & topicName, const std::string & datatype, const std::string & source, int period)
00047 throw(CMSException);
00048
00049 virtual ~FeatureSender()
00050 {}
00051
00063 FeatureSender(const std::string & cmsUrl, const std::string & cmsUser, const std::string & cmsPassword, const std::string & topicName, const std::string & datatype, const std::string & source, int period)
00064 throw (CMSException);
00065
00074 void setFeatureNames(const std::vector<std::string> & aFeatureNames)
00075 throw (SystemConfigurationException);
00076
00081 bool areFeatureNamesSet();
00082
00087 const std::vector<std::string> & getFeatureNames()
00088 {
00089 return featureNames;
00090 }
00091
00113 void sendFeatureVector(const std::vector<float> & features, long long usertime,
00114 bool sendBinary = false, const std::string & contentID = "",
00115 long long contentCreationTime = -1, const std::string & contentType = "")
00116 throw(CMSException, SystemConfigurationException);
00117
00118
00119
00120 protected:
00121 std::vector<std::string> featureNames;
00122
00123 void sendBinaryFeatureVector(const std::vector<float> & features, long long usertime, const std::string & contentID,
00124 long long contentCreationTime, const std::string & contentType)
00125 throw(CMSException);
00126
00127 void sendTextFeatureVector(const std::vector<float> & features, long long usertime, const std::string & contentID,
00128 long long contentCreationTime, const std::string & contentType)
00129 throw(CMSException);
00130
00131 };
00132
00133 }
00134 }
00135 }
00136
00137
00138
00139 #endif
00140