Matrix Science header

ms_xml_parameters.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_xml_parameters.hpp                                                #
00004 # 'msparser' toolkit                                                         #
00005 # Base class for parameterType-definitions                                   #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2019 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011  * @(#)$Source: parser/inc/ms_xml_parameters.hpp $
00012  * @(#)$Revision: 8fee77726a13a239ca8bcf2b46212bff297db9b7 | MSPARSER_REL_2_8_1-0-gea32989045 $
00013  * @(#)$Date: 2018-12-20 10:50:55 +0000 $
00014 ##############################################################################
00015  */
00016 
00017 #ifndef MS_XML_PARAMETERS_HPP
00018 #define MS_XML_PARAMETERS_HPP
00019 
00020 
00021 #include <string>
00022 #include <vector>
00023 
00024 namespace msparser_internal {
00025     class ms_xml_xmlloader;
00026     class ms_XMLHelper;
00027     class ms_XMLElement;
00028 }
00029 
00030 namespace matrix_science {
00031     class ms_xml_schema; // forward declaration
00032 
00038 
00039 
00045     class MS_MASCOTRESFILE_API ms_xml_parameter: public ms_xml_IValidatable
00046     {
00047     public:
00049         ms_xml_parameter();
00050 
00052         ms_xml_parameter(const ms_xml_parameter& src);
00053 
00055         virtual ~ms_xml_parameter();
00056 
00058         void defaultValues();
00059 
00061         void copyFrom(const ms_xml_parameter* right);
00062 
00063 #ifndef SWIG
00064 
00065         ms_xml_parameter& operator=(const ms_xml_parameter& right);
00066 #endif
00067 
00068         virtual std::string getSchemaType() const = 0;
00069 
00071         std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00072 
00074         std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00075 
00076 
00078         bool haveName() const;
00079 
00081         std::string getName() const;
00082 
00084         void setName(const char* value);
00085 
00087         void dropName();
00088 
00090         virtual std::string getNameSchemaType() const = 0;
00091 
00092 
00094         bool haveDescription() const;
00095 
00097         std::string getDescription() const;
00098 
00100         void setDescription(const char* value);
00101 
00103         void dropDescription();
00104 
00106         virtual std::string getDescriptionSchemaType() const = 0;
00107 
00108 
00110         std::string getValue() const;
00111 
00113         void setValue(const char* value);
00114 
00116         virtual std::string getValueSchemaType() const = 0;
00117 
00118     protected:
00119         virtual bool saveToXML_ParameterByNumber(msparser_internal::ms_XMLHelper &helper, msparser_internal::ms_XMLElement &rootEl) const = 0;
00120 
00121         std::string _name;
00122         bool _name_set;
00123 
00124         std::string _description;
00125         bool _description_set;
00126 
00127         std::string _value;
00128 
00129     }; // class ms_xml_parameter
00130 
00132 
00139     class MS_MASCOTRESFILE_API ms_xml_parameters: public ms_xml_IValidatable
00140     {
00141     public:
00143         ms_xml_parameters();
00144 
00146         ms_xml_parameters(const ms_xml_parameters& src);
00147 
00149         virtual ~ms_xml_parameters();
00150 
00152         void defaultValues();
00153 
00155         virtual std::string getSchemaType() const = 0;
00156 
00158         std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00159 
00161         std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00162 
00163 
00165         virtual int getNumberOfParameters() const = 0;
00166 
00168         virtual void clearParameters() = 0;
00169 
00171         virtual bool deleteParameterByNumber(const int idx) = 0;
00172 
00174         virtual bool deleteParameterByName(const char *name) = 0;
00175 
00177         virtual std::string getParameterSchemaType() const = 0;
00178 
00179     protected:
00180         virtual bool saveToXML_Parameters(msparser_internal::ms_XMLHelper &helper, msparser_internal::ms_XMLElement &rootEl) const = 0;
00181 
00182     }; // class ms_xml_parameters
00183  // end of config_group
00185 
00186 } // namespace matrix_science
00187 
00188 #endif // MS_XML_PARAMETERS_HPP
00189 
00190 /*------------------------------- End of File -------------------------------*/
00191 

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:30