Matrix Science header

ms_databaseoptions.hpp

00001 /*
00002 ##############################################################################
00003 # file: ms_databaseoptions.hpp                                               #
00004 # 'msparser' toolkit                                                         #
00005 # Encapsulates "mascot.dat"-file that describes most important parameters    #
00006 ##############################################################################
00007 # COPYRIGHT NOTICE                                                           #
00008 # Copyright 1998-2003 Matrix Science Limited  All Rights Reserved.           #
00009 #                                                                            #
00010 ##############################################################################
00011 #    $Archive:: /Mowse/ms_mascotresfile/include/ms_databaseoptions.hpp     $ #
00012 #     $Author: villek $ #
00013 #       $Date: 2016/06/30 14:17:12 $ #
00014 #   $Revision: 1.20 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_DATABASEOPTIONS_HPP
00020 #define MS_DATABASEOPTIONS_HPP
00021 
00022 #ifdef _WIN32
00023 #pragma warning(disable:4251)   // Don't want all classes to be exported
00024 #pragma warning(disable:4786)   // Debug symbols too long
00025 #   ifndef _MATRIX_USE_STATIC_LIB
00026 #       ifdef MS_MASCOTRESFILE_EXPORTS
00027 #           define MS_MASCOTRESFILE_API __declspec(dllexport)
00028 #       else
00029 #           define MS_MASCOTRESFILE_API __declspec(dllimport)
00030 #       endif
00031 #   else
00032 #       define MS_MASCOTRESFILE_API
00033 #   endif
00034 #else
00035 #   define MS_MASCOTRESFILE_API
00036 #endif
00037 
00038 // for the sake of #include <string>
00039 #ifdef __ALPHA_UNIX__
00040 #include <ctype.h>
00041 #endif
00042 #include <string>
00043 #include <vector>
00044 
00045 
00046 namespace matrix_science {
00057     enum DATABASE_TYPE
00058     {
00059         AA=0, 
00060         NA=1, 
00061         SL=2, 
00062         SLREF=3, 
00063     };
00064 
00066 
00077     class MS_MASCOTRESFILE_API ms_databaseoptions
00078     {
00079         friend class ms_datfile;
00080         friend class ms_databases;
00081 
00082     public:
00084 
00089         enum {
00090             NUM_THREADS_AUTO_DETECT = -1 
00091         };
00092 
00093 
00095         ms_databaseoptions();
00096 
00098         ms_databaseoptions(const ms_databaseoptions& src);
00099 
00101         ~ms_databaseoptions();
00102 
00104         void defaultValues();
00105 
00107         void copyFrom(const ms_databaseoptions* right);
00108 
00109 #ifndef SWIG
00110 
00111         ms_databaseoptions& operator=(const ms_databaseoptions& right);
00112 #endif
00113 
00114         bool isActive() const;
00115 
00117         void setActive(const bool value);
00118 
00120         std::string getName() const;
00121 
00123         void setName(const char* name);
00124 
00126         std::string getPath() const;
00127 
00129         void setPath(const char* path);
00130 
00132         int getDBType() const;
00133 
00135         void setDBType(const int type);
00136 
00138         bool isMemoryMapFiles() const;
00139 
00141         void setMemoryMapFiles(const bool flag);
00142 
00144         int getNumberOfThreads() const;
00145 
00147         void setNumberOfThreads(const int number);
00148 
00150         bool isLockMemory() const;
00151 
00153         void setLockMemory(const bool flag);
00154 
00156         bool isLocalRefFile() const;
00157 
00159         void setLocalRefFile(const bool flag);
00160 
00162         int getAccessionParseRuleIndex() const;
00163 
00165         void setAccessionParseRuleIndex(const int index);
00166 
00168         int getDescriptionParseRuleIndex() const;
00169 
00171         void setDescriptionParseRuleIndex(const int index);
00172 
00174         int getAccessionRefParseRuleIndex() const;
00175 
00177         void setAccessionRefParseRuleIndex(const int index);
00178 
00180         int getTaxonomyParseRuleIndex() const;
00181 
00183         void setTaxonomyParseRuleIndex(const int index);
00184 
00186         bool isBlastIndexFiles() const;
00187 
00189         void setBlastIndexFiles(const bool flag);
00190 
00192         void setPreceedingComments(const std::string &str);
00193 
00195         const std::string& getPreceedingComments() const;
00196 
00197     private:
00198         std::string getStringValue() const;
00199 
00200         bool        active_;
00201         std::string name_;
00202         std::string path_;
00203         int         type_;
00204         int         __numEntries_;  // no longer used
00205         int         __uniqueID_;    // no longer used
00206         bool        mmapFiles_;
00207         bool        __useBlastIndexFiles_;    // no longer used - was also blocks
00208         int         numThreads_;
00209         bool        lockMemory_;
00210         bool        hasRefFile_;
00211         int         accessionParseRule_;
00212         int         descriptionParseRule_;
00213         int         accessionRefParseRule_;
00214         int         taxonomyParseRule_;
00215         std::string comment_;
00216     }; // class ms_databaseoptions
00217 
00219 
00243     class MS_MASCOTRESFILE_API ms_databases: public ms_customproperty
00244     {
00245         friend class ms_datfile;
00246     public:
00248         ms_databases();
00249 
00251         ms_databases(const ms_databases& src);
00252 
00254         ~ms_databases();
00255 
00257         void defaultValues();
00258 
00260         void copyFrom(const ms_databases* right);
00261 
00262 #ifndef SWIG
00263 
00264         ms_databases& operator=(const ms_databases& right);
00265 #endif
00266 
00267         bool isSectionAvailable() const;
00268 
00270         void setSectionAvailable(const bool value);
00271 
00273         int getNumberOfDatabases() const;
00274 
00276         const ms_databaseoptions* getDatabase(const int index) const;
00277 
00279         void clearDatabases();
00280 
00282         void appendDatabase(const ms_databaseoptions* item);
00283 
00285         int findDatabase(const char* dbName, const bool searchInactive = false) const;
00286 
00288         bool updateDatabaseByNumber(const int num, const ms_databaseoptions db);
00289 
00291         bool updateDatabaseByName(const char* name, const ms_databaseoptions db);
00292 
00294         bool deleteDatabaseByNumber(const int num);
00295 
00297         bool deleteDatabaseByName(const char* name);
00298 
00299 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00300 #include "suppress_ms_customproperty.hpp"
00301 #endif
00302 
00303     private:
00304         void appendDatabase(const ms_databaseoptions* item, const char *propVal);
00305         void setFollowingComments(const std::string &str);
00306         const std::string& getFollowingComments() const;
00307 
00308         bool sectionAvailable_;
00309         std::vector< ms_databaseoptions* > dbases_;
00310         std::string followingComments_;
00311     }; // class ms_databases // end of config_group
00313 } // namespace matrix_science
00314 
00315 #endif // MS_DATABASEOPTIONS_HPP
00316 
00317 /*------------------------------- End of File -------------------------------*/
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:50