semaine::cms::sender::FeatureSender Class Reference
#include <FeatureSender.h>
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:
-
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:
-
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) |
Send a vector of float features. Before sending features, must be called, and the names must correspond to the features passed in the argument. features the features to send. usertime the "user" time at which this message is being sent, in milliseconds since system startup. sendBinary whether to send the message as a binary message (defaults to false) contentID a unique identifier for the message's content. (optional, defaults to empty string) If this is not the empty string, it will cause the addition of the String property content-id
in the message. contentCreationTime the time when the content in this message was created. (optional, defaults to -1) If this is not negative, it will cause the addition of the Long property content-creation-time
in the message. contentType an optional content type for the message's content; (optional, defaults to empty string) The value may be one of SEMAINEMessage::CONTENT_TYPE_UTTERANCE, SEMAINEMessage::CONTENT_TYPE_LISTENERVOCALISATION, SEMAINEMessage::CONTENT_TYPE_VISUALONLY, or any other string. If this is not the empty string, it will cause the addition of the String property content-type
in the message. CMSException SystemConfigurationException if the feature names have not been set, or if the number of features is not the same as the number of feature names
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
The documentation for this class was generated from the following files: