semaine::cms::sender::FeatureSender Class Reference

#include <FeatureSender.h>

Inheritance diagram for semaine::cms::sender::FeatureSender:
semaine::cms::sender::Sender semaine::cms::IOBase

List of all members.

Public Member Functions

 FeatureSender (const std::string &topicName, const std::string &datatype, const std::string &source, int period) throw (CMSException)
virtual ~FeatureSender ()
 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) throw (CMSException)
void setFeatureNames (const std::vector< std::string > &aFeatureNames) throw (SystemConfigurationException)
bool areFeatureNamesSet ()
const std::vector< std::string > & getFeatureNames ()
void sendFeatureVector (const std::vector< float > &features, long long usertime, bool sendBinary=false, const std::string &contentID="", long long contentCreationTime=-1, const std::string &contentType="") throw (CMSException, SystemConfigurationException)

Protected Member Functions

void sendBinaryFeatureVector (const std::vector< float > &features, long long usertime, const std::string &contentID, long long contentCreationTime, const std::string &contentType) throw (CMSException)
void sendTextFeatureVector (const std::vector< float > &features, long long usertime, const std::string &contentID, long long contentCreationTime, const std::string &contentType) throw (CMSException)

Protected Attributes

std::vector< std::string > featureNames

Constructor & Destructor Documentation

semaine::cms::sender::FeatureSender::FeatureSender ( const std::string &  topicName,
const std::string &  datatype,
const std::string &  source,
int  period 
) throw (CMSException)

Create a new Sender to the given topic on the default JMS server. The default JMS server is determined as follows:

  • jms URL: default value tcp://localhost:61616;
  • jms User: default value empty;
  • jms Password: default value empty.

Datatype and source will be sent with every message.

Parameters:
topic the name of the topic to send to.
datatype the name of the type of data being sent.
source the name of the component sending the data.
the period in which we intend to send data, in milliseconds
Exceptions:
CMSException 
virtual semaine::cms::sender::FeatureSender::~FeatureSender (  )  [inline, virtual]
semaine::cms::sender::FeatureSender::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 
) throw (CMSException)

Create a new CMS IOBase connection with the given topic on the given JMS server.

Parameters:
cmsUrl the url where to contact the JMS server
cmsUser the username to use (can be an empty string)
cmsPassword the password to use (can be an empty string)
topicName the name of the topic to send to.
datatype the name of the type of data being sent.
source the name of the component sending the data.
the period in which we intend to send data, in milliseconds
Exceptions:
CMSException 

Member Function Documentation

bool semaine::cms::sender::FeatureSender::areFeatureNamesSet (  ) 

Returns 1, when feature names were already set and 0 otherwise.

const std::vector<std::string>& semaine::cms::sender::FeatureSender::getFeatureNames (  )  [inline]

Provides access to the array of feature names. May be useful for debugging.

Returns:
the internal feature names array.
void semaine::cms::sender::FeatureSender::sendBinaryFeatureVector ( const std::vector< float > &  features,
long long  usertime,
const std::string &  contentID,
long long  contentCreationTime,
const std::string &  contentType 
) throw (CMSException) [protected]
void semaine::cms::sender::FeatureSender::sendFeatureVector ( const std::vector< float > &  features,
long long  usertime,
bool  sendBinary = false,
const std::string &  contentID = "",
long long  contentCreationTime = -1,
const std::string &  contentType = "" 
) throw (CMSException, SystemConfigurationException)
void semaine::cms::sender::FeatureSender::sendTextFeatureVector ( const std::vector< float > &  features,
long long  usertime,
const std::string &  contentID,
long long  contentCreationTime,
const std::string &  contentType 
) throw (CMSException) [protected]
void semaine::cms::sender::FeatureSender::setFeatureNames ( const std::vector< std::string > &  aFeatureNames  )  throw (SystemConfigurationException)

Initiate the list of feature names to use. This method must be called exactly once, after the creation of the object and before the first send operation.

Parameters:
aFeatureNames the feature names, in exactly the same order as the features that will be sent.
Exceptions:
SystemConfigurationException if feature names are already set.

Member Data Documentation

std::vector<std::string> semaine::cms::sender::FeatureSender::featureNames [protected]

The documentation for this class was generated from the following files:
Generated on Tue Dec 14 17:13:18 2010 for SEMAINE by  doxygen 1.6.3