Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_xml_parameters.hpp
1/*
2##############################################################################
3# file: ms_xml_parameters.hpp #
4# 'msparser' toolkit #
5# Base class for parameterType-definitions #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2019 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11 * @(#)$Source: parser/inc/ms_xml_parameters.hpp $
12 * @(#)$Revision: 8fee77726a13a239ca8bcf2b46212bff297db9b7 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
13 * @(#)$Date: 2018-12-20 10:50:55 +0000 $
14##############################################################################
15 */
16
17#ifndef MS_XML_PARAMETERS_HPP
18#define MS_XML_PARAMETERS_HPP
19
20
21#include <string>
22#include <vector>
23
24namespace msparser_internal {
25 class ms_xml_xmlloader;
26 class ms_XMLHelper;
27 class ms_XMLElement;
28}
29
30namespace matrix_science {
31 class ms_xml_schema; // forward declaration
32
39
45 class MS_MASCOTRESFILE_API ms_xml_parameter: public ms_xml_IValidatable
46 {
47 public:
50
53
55 virtual ~ms_xml_parameter();
56
58 void defaultValues();
59
61 void copyFrom(const ms_xml_parameter* right);
62
63#ifndef SWIG
65 ms_xml_parameter& operator=(const ms_xml_parameter& right);
66#endif
68 virtual std::string getSchemaType() const = 0;
69
71 std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
72
74 std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
75
76
78 bool haveName() const;
79
81 std::string getName() const;
82
84 void setName(const char* value);
85
87 void dropName();
88
90 virtual std::string getNameSchemaType() const = 0;
91
92
94 bool haveDescription() const;
95
97 std::string getDescription() const;
98
100 void setDescription(const char* value);
101
103 void dropDescription();
104
106 virtual std::string getDescriptionSchemaType() const = 0;
107
108
110 std::string getValue() const;
111
113 void setValue(const char* value);
114
116 virtual std::string getValueSchemaType() const = 0;
117
118 protected:
119 virtual bool saveToXML_ParameterByNumber(msparser_internal::ms_XMLHelper &helper, msparser_internal::ms_XMLElement &rootEl) const = 0;
120
121 std::string _name;
122 bool _name_set;
123
124 std::string _description;
125 bool _description_set;
126
127 std::string _value;
128
129 }; // class ms_xml_parameter
130
132
139 class MS_MASCOTRESFILE_API ms_xml_parameters: public ms_xml_IValidatable
140 {
141 public:
144
147
149 virtual ~ms_xml_parameters();
150
152 void defaultValues();
153
155 virtual std::string getSchemaType() const = 0;
156
158 std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
159
161 std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
162
163
165 virtual int getNumberOfParameters() const = 0;
166
168 virtual void clearParameters() = 0;
169
171 virtual bool deleteParameterByNumber(const int idx) = 0;
172
174 virtual bool deleteParameterByName(const char *name) = 0;
175
177 virtual std::string getParameterSchemaType() const = 0;
178
179 protected:
180 virtual bool saveToXML_Parameters(msparser_internal::ms_XMLHelper &helper, msparser_internal::ms_XMLElement &rootEl) const = 0;
181
182 }; // class ms_xml_parameters
183 // end of config_group
185
186} // namespace matrix_science
187
188#endif // MS_XML_PARAMETERS_HPP
189
190/*------------------------------- End of File -------------------------------*/
191
Parameter name and value pair.
Definition: ms_xml_parameters.hpp:46
virtual std::string getValueSchemaType() const =0
Obtain a symbolic name for the value attribute schema type.
virtual std::string getDescriptionSchemaType() const =0
Obtain a symbolic name for the description attribute schema type.
virtual std::string getNameSchemaType() const =0
Obtain a symbolic name for the name attribute schema type.
virtual std::string getSchemaType() const =0
Returns name of the schema type that can be used to validate this element.
A class that represents a base parametersType.
Definition: ms_xml_parameters.hpp:140
virtual int getNumberOfParameters() const =0
Returns the number of parameters held.
virtual bool deleteParameterByName(const char *name)=0
Remove a parameter from the list in memory by its unique name.
virtual std::string getParameterSchemaType() const =0
Obtain a symbolic name for the parameter element schema type.
virtual void clearParameters()=0
Deletes all parameters from the list.
virtual bool deleteParameterByNumber(const int idx)=0
Remove a parameter from the list in memory by its index.
virtual std::string getSchemaType() const =0
Returns name of the schema type that can be used to validate this element.