Matrix Science header

ms_umod_composition.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_umod_composition.hpp                                                #
00004 # 'msparser' toolkit                                                         #
00005 # Represents 'composition_t' type from unimod.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_umod_composition.hpp,v $
00012  * @(#)$Revision: 1.9 $
00013  * @(#)$Date: 2016/05/25 12:57:48 $
00014 ##############################################################################
00015  */
00016 
00017 #ifndef MS_UMOD_COMPOSITION_HPP
00018 #define MS_UMOD_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_umod_xmlloader;
00042 }
00043 
00044 namespace matrix_science {
00045 
00046     class ms_umod_elemref; // forward declaration
00047     class ms_quant_composition; // forward declaration
00048     class ms_quant_component;  // forward declaration
00049     class ms_umod_configfile;  // forward declaration
00050     class ms_xml_schema; // forward declaration
00051 
00057 
00058 
00062     class MS_MASCOTRESFILE_API ms_umod_composition: public ms_xml_IValidatable
00063     {
00064         friend class msparser_internal::ms_umod_xmlloader;
00065         friend class ms_umod_configfile;
00066 
00067     public:
00069         ms_umod_composition();
00070 
00072         ms_umod_composition(const ms_umod_composition& src);
00073 
00075         ms_umod_composition(const ms_quant_composition& src, const ms_umod_configfile& umodFile);
00076 
00078         void updateMasses(const ms_umod_configfile& umodFile, const ms_quant_component& quantComp);
00079 
00081         virtual ~ms_umod_composition();
00082 
00084         void defaultValues();
00085 
00087         void copyFrom(const ms_umod_composition* right);
00088 
00090         void copyFrom(const ms_quant_composition* right, const ms_umod_configfile& umodFile);
00091 
00092 #ifndef SWIG
00093 
00094         ms_umod_composition& operator=(const ms_umod_composition& right);
00095 #endif
00096 
00097         virtual std::string getSchemaType() const;
00098 
00100         virtual std::string validateShallow(const ms_xml_schema *pSchemaFileObj) const;
00101 
00103         virtual std::string validateDeep(const ms_xml_schema *pSchemaFileObj) const;
00104 
00105 
00107         int getNumberOfElemRefs() const;
00108 
00110         void clearElemRefs();
00111 
00113         void appendElemRef(const ms_umod_elemref *elemref);
00114 
00116         const ms_umod_elemref* getElemRef(const int idx) const;
00117 
00119         bool updateElemRef(const int idx, const ms_umod_elemref *elemref);
00120 
00122         bool deleteElemRef(const int idx);
00123 
00125         std::string getElemRefSchemaType() const;
00126 
00127 
00129         bool haveCompositionString() const;
00130 
00132         std::string getCompositionString() const;
00133 
00135         void setCompositionString(const char* value);
00136 
00138         void dropCompositionString();
00139 
00141         std::string getCompositionStringSchemaType() const;
00142 
00143 
00145         bool haveAvgeMass() const;
00146 
00148         double getAvgeMass() const;
00149 
00151         void setAvgeMass(const double value);
00152 
00154         void dropAvgeMass();
00155 
00157         std::string getAvgeMassSchemaType() const;
00158 
00159 
00161         bool haveMonoMass() const;
00162 
00164         double getMonoMass() const;
00165 
00167         void setMonoMass(const double value);
00168 
00170         void dropMonoMass();
00171 
00173         std::string getMonoMassSchemaType() const;
00174 
00176         bool isSameAs(const ms_umod_composition& right) const;
00177 
00178     private:
00179 
00180         typedef std::vector< ms_umod_elemref* > elemref_vector;
00181         elemref_vector _elemRefs;
00182 
00183         std::string _composition;
00184         bool _composition_set;
00185 
00186         double _avgeMass;
00187         bool _avgeMass_set;
00188 
00189         double _monoMass;
00190         bool _monoMass_set;
00191     }; // class ms_umod_composition
00192  // end of config_group
00194 
00195 } // namespace matrix_science
00196 
00197 #endif // MS_UMOD_COMPOSITION_HPP
00198 
00199 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:51