Matrix Science header

ms_quant_composition.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_quant_composition.hpp                                             #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates "compositionType" 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_composition.hpp,v $
00012  * @(#)$Revision: 1.11 $
00013  * @(#)$Date: 2010/09/06 16:18:57 $
00014 ##############################################################################
00015  */
00016 
00017 #ifndef MS_QUANT_COMPOSITION_HPP
00018 #define MS_QUANT_COMPOSITION_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 // forward declarations
00040 namespace msparser_internal {
00041     class ms_quant_xmlloader;
00042 }
00043 
00044 namespace matrix_science {
00045 
00046     class ms_xml_schema; // forward declaration
00047 
00053 
00054     class MS_MASCOTRESFILE_API ms_quant_element: public ms_xml_IValidatable
00055     {
00056         friend class msparser_internal::ms_quant_xmlloader;
00057 
00058     public:
00059 #ifdef __MINGW__
00060 
00061         // MINGW compiler crashes without 'inline'.
00062         inline ms_quant_element();
00063 #else
00064 
00065         ms_quant_element();
00066 #endif
00067 
00069         ms_quant_element(const ms_quant_element& src);
00070 
00072         virtual ~ms_quant_element();
00073 
00075         void defaultValues();
00076 
00078         void copyFrom(const ms_quant_element* right);
00079 
00080 #ifndef SWIG
00081 
00082         ms_quant_element& operator=(const ms_quant_element& right);
00083 #endif
00084         
00086         virtual std::string getSchemaType() const;
00087 
00089         virtual std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00090 
00092         virtual std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00093 
00094 
00096         bool haveSymbol() const;
00097 
00099         std::string getSymbol() const;
00100 
00102         void setSymbol(const char* symbol);
00103 
00105         void dropSymbol();
00106 
00108         std::string getSymbolSchemaType() const;
00109 
00110         
00112         bool haveNumber() const;
00113 
00115         int getNumber() const;
00116 
00118         void setNumber(const int number);
00119 
00121         void dropNumber();
00122 
00124         std::string getNumberSchemaType() const;
00125 
00126 
00127     private:
00128         std::string _symbol;
00129         bool _symbol_set;
00130 
00131         int _number;
00132         bool _number_set;
00133 
00134     }; // class ms_quant_element
00135 
00137 
00140     class MS_MASCOTRESFILE_API ms_quant_composition: public ms_xml_IValidatable
00141     {
00142         friend class msparser_internal::ms_quant_xmlloader;
00143     public:
00145         ms_quant_composition();
00146 
00148         ms_quant_composition(const ms_quant_composition& src);
00149 
00151         virtual ~ms_quant_composition();
00152 
00154         void defaultValues();
00155 
00157         void copyFrom(const ms_quant_composition* right);
00158 
00159 #ifndef SWIG
00160 
00161         ms_quant_composition& operator=(const ms_quant_composition& right);
00162 #endif
00163 
00164         virtual std::string getSchemaType() const;
00165 
00167         virtual std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00168 
00170         virtual std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00171 
00172 
00174         int getNumberOfElements() const;
00175 
00177         void clearElements();
00178 
00180         void appendElement(const ms_quant_element *element);
00181 
00183         const ms_quant_element * getElement(const int idx) const;
00184 
00186         bool updateElement(const int idx, const ms_quant_element* element);
00187 
00189         bool deleteElement(const int idx);
00190 
00192         std::string getElementSchemaType() const;
00193 
00194     private:
00195         typedef std::vector< ms_quant_element* > element_vector;
00196         element_vector _elements;
00197 
00198     }; // class ms_quant_composition
00199  // end of config_group
00201 
00202 } // namespace matrix_science
00203 
00204 #endif // MS_QUANT_COMPOSITION_HPP
00205 
00206 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51