00001 #ifndef optionServer_h
00002 #define optionServer_h
00003
00004 #include "Event/serviceI.h"
00005 #include "Event/serverVI.h"
00006
00007 00009
00010 \e OptionServer sets options to classed derived from optionVI and previously declared
00011 into its server.<br>
00012 \e OptionServer reads and sets options from an external file.<br>
00013 <ul>
00014 <li> The options can be set to classes derived from optionVI.They should be declared
00015 into the server, using the method \c addToServer().
00016 Every object should have a unique name into the server.
00017 <li> The \c setOption() method allows to set a collection of options from a external
00018 file. The options should be listed in the file in the following way:
00019 \e "objectName parName parType parContent",
00020 where \e parType can be "S" for string, "D" for double or "I" for integer.
00021 A line started with \e "//" in the file will be ignored and it can be use to put comments).
00022 <li> Use the method \c setOptionFileName() to set the name of the file with
00023 the list of options to apply.
00024 <li> Options can be apply from a external client via the methods \c setOption(objectName, parName, parContent).
00025 The option is called parName and the content is parContent.
00026 </ul>
00027 */
00028
00029
00030
00031
00032
00033 class optionServer
00034
00035 {
00036 friend class optionManager;
00037
00038 public:
00039
00041 optionServer();
00043 virtual ~optionServer();
00044
00045 void setOptionFileName(std::string name) {m_optionFileName = name;}
00047 void setOption();
00048
00050 virtual bool search(std::string name) const {return m_server->search(name);}
00052 virtual void addToServer(std::string name, optionVI* op);
00053
00055 virtual void writeOutOptionsServer() const;
00057 virtual void writeOut() const;
00058
00059 protected:
00060
00062 optionVI* getOption(std::string name) const;
00063
00065 void setOption(std::string className, std::string par, std::string con);
00067 void setOption(std::string className, std::string par, double d);
00069 void setOption(std::string className, std::string par, int i);
00070
00071 protected:
00072
00074 std::string m_optionFileName;
00075
00077 serverVI<optionVI>* m_server;
00078
00079 };
00080
00081
00082 #endif