Matrix Science header

ms_quant_parameters.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_quant_parameters.hpp                                              #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates parametersType-definition from "quantitation.xml"-file        #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2006 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011  * @(#)$Source: /vol/cvsroot/parser/inc/ms_quant_parameters.hpp,v $
00012  * @(#)$Revision: 1.11 $
00013  * @(#)$Date: 2010/09/06 16:18:57 $
00014 ##############################################################################
00015  */
00016 
00017 #ifndef MS_QUANT_PARAMETERS_HPP
00018 #define MS_QUANT_PARAMETERS_HPP
00019 
00020 #ifdef _WIN32
00021 #pragma warning(disable:4251)   // Don't want all classes to be exported
00022 #pragma warning(disable:4786)   // Debug symbols too long
00023 #   ifndef _MATRIX_USE_STATIC_LIB
00024 #       ifdef MS_MASCOTRESFILE_EXPORTS
00025 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00026 #       else
00027 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00028 #       endif
00029 #   else
00030 #       define MS_MASCOTRESFILE_API
00031 #   endif
00032 #else
00033 #   define MS_MASCOTRESFILE_API
00034 #endif
00035 
00036 #include <string>
00037 #include <vector>
00038 
00039 namespace msparser_internal {
00040     class ms_quant_xmlloader;
00041 }
00042 
00043 namespace matrix_science {
00044 
00045     class ms_xml_schema; // forward declaration
00046 
00052 
00053     class MS_MASCOTRESFILE_API ms_quant_parameter: public ms_xml_IValidatable
00054     {
00055         friend class msparser_internal::ms_quant_xmlloader;
00056 
00057     public:
00058 #ifdef __MINGW__
00059 
00060         // MINGW compiler crashes without 'inline'.
00061         inline ms_quant_parameter();
00062 #else
00063 
00064         ms_quant_parameter();
00065 #endif
00066 
00068         ms_quant_parameter(const ms_quant_parameter& src);
00069 
00071         virtual ~ms_quant_parameter();
00072 
00074         void defaultValues();
00075 
00077         void copyFrom(const ms_quant_parameter* right);
00078 
00079 #ifndef SWIG
00080 
00081         ms_quant_parameter& operator=(const ms_quant_parameter& right);
00082 #endif
00083 
00084         virtual std::string getSchemaType() const;
00085 
00087         virtual std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00088 
00090         virtual std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00091 
00092 
00094         bool haveName() const;
00095 
00097         std::string getName() const;
00098 
00100         void setName(const char* value);
00101 
00103         void dropName();
00104 
00106         std::string getNameSchemaType() const;
00107 
00108 
00110         bool haveDescription() const;
00111 
00113         std::string getDescription() const;
00114 
00116         void setDescription(const char* value);
00117 
00119         void dropDescription();
00120 
00122         std::string getDescriptionSchemaType() const;
00123 
00124 
00126         std::string getValue() const;
00127 
00129         void setValue(const char* value);
00130 
00132         std::string getValueSchemaType() const;
00133 
00134     private:
00135         std::string _name;
00136         bool _name_set;
00137 
00138         std::string _description;
00139         bool _description_set;
00140 
00141         std::string _value;
00142 
00143     }; // class ms_quant_parameter
00144 
00146 
00149     class MS_MASCOTRESFILE_API ms_quant_parameters: public ms_xml_IValidatable
00150     {
00151         friend class msparser_internal::ms_quant_xmlloader;
00152     public:
00154         ms_quant_parameters();
00155 
00157         ms_quant_parameters(const ms_quant_parameters& src);
00158 
00160         virtual ~ms_quant_parameters();
00161 
00163         void defaultValues();
00164 
00166         void copyFrom(const ms_quant_parameters* right);
00167 
00168 #ifndef SWIG
00169 
00170         ms_quant_parameters& operator=(const ms_quant_parameters& right);
00171 #endif
00172 
00173         virtual std::string getSchemaType() const;
00174 
00176         virtual std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00177 
00179         virtual std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00180 
00181 
00183         int getNumberOfParameters() const;
00184 
00186         void clearParameters();
00187 
00189         void appendParameter(const ms_quant_parameter *item);
00190 
00192         const ms_quant_parameter * getParameterByNumber(const int idx) const;
00193 
00195         const ms_quant_parameter * getParameterByName(const char *name) const;
00196 
00198         bool updateParameterByNumber(const int idx, const ms_quant_parameter *param);
00199 
00201         bool updateParameterByName(const char *name, const ms_quant_parameter *param);
00202 
00204         bool deleteParameterByNumber(const int idx);
00205 
00207         bool deleteParameterByName(const char *name);
00208 
00210         std::string getParameterSchemaType() const;
00211 
00212     private:
00213         typedef std::vector< ms_quant_parameter* > entries_vector;
00214         entries_vector _entries;
00215 
00216     }; // class ms_quant_parameters
00217  // end of config_group
00219 
00220 } // namespace matrix_science
00221 
00222 #endif // MS_QUANT_PARAMETERS_HPP
00223 
00224 /*------------------------------- End of File -------------------------------*/
00225 
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51