Go to the documentation of this file.00001 #ifndef _parameter_task_H
00002 #define _parameter_task_H
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 #ifndef __cplusplus
00034 #error This is a C++ include file and cannot be used from plain C
00035 #endif
00036
00037 #include <map>
00038 #include <memory>
00039 #include <vector>
00040 #include "taskComponent.h"
00041 #include <xercesc/dom/DOMDocument.hpp>
00042 #include <ParamSetDef.h>
00043 #include <task.h>
00044
00045 using Parameters::ParamSetDef;
00046 using XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument;
00047
00048 namespace ACS
00049 {
00058 class parameterTask : public virtual acscomponent::ACSComponentImpl,
00059 public virtual POA_ACS::TaskComponent, public ACS::Task
00060 {
00061 public:
00067 parameterTask(const ACE_CString& name, maci::ContainerServices* containerServices);
00068
00072 virtual ~parameterTask(){}
00073
00081 virtual void run (const ACS::StringSequence & parameters, const char* fileName);
00082
00083 private:
00084
00085
00086
00087 void buildParameterMap(const ACS::StringSequence & parameters, const string & baseFileName) ;
00088
00089
00090
00091 void checkPosition(string::size_type currPosition, unsigned int length, const string & msg) ;
00092
00093
00094
00095 string buildParameterSetXML(const string & fileNamePrefix);
00096 DOMElement* createBoolElement(const string & paramName, const vector<string> & values, DOMDocument*);
00097 DOMElement* createIntElement(const string & paramName, const vector<string> & values, DOMDocument*);
00098 DOMElement* createIntArrayElement(const string & paramName, const vector<string> & values, DOMDocument*);
00099 DOMElement* createDoubleElement(const string & paramName, const vector<string> & values, DOMDocument*);
00100 DOMElement* createDoubleArrayElement(const string & paramName, const vector<string> & values, DOMDocument*);
00101 DOMElement* createStringElement(const string & paramName, const vector<string> & values, DOMDocument*);
00102 DOMElement* createStringArrayElement(const string & paramName, const vector<string> & values, DOMDocument*);
00103 DOMElement* createSimpleElement(const string & paramName, const vector<string> & values, DOMDocument *doc,
00104 const string & paramType);
00105 DOMElement* createArrayElement(const string & paramName, const vector<string> & values,
00106 DOMDocument *doc, const string & paramType);
00107
00108
00109
00110
00111 vector<string> parseBoolElement(const string & valueString);
00112
00113
00114
00115 vector<string> parseIntElement(const string & valueString);
00116
00117
00118
00119 vector<string> parseIntArrayElement(const string & valueString);
00120
00121
00122
00123 vector<string> parseDoubleElement(const string & valueString);
00124
00125
00126
00127 vector<string> parseDoubleArrayElement(const string & valueString);
00128
00129
00130
00131 vector<string> parseStringElement(const string & valueString);
00132
00133
00134
00135 vector<string> parseStringArrayElement(const string & valueString);
00136
00137
00138 map<string, vector<string> > parameterMap;
00139
00140
00141 auto_ptr<DOMDocument> domDocument;
00142
00143
00144 auto_ptr<ParamSetDef> paramSetDef;
00145 };
00146
00147 };
00148 #endif