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@matrixscience.com $ #
00013 #       $Date: 2018-07-30 16:23:53 +0100 $ #
00014 #   $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_2_8_1-0-gea32989045 $ #
00015 # $NoKeywords::                                                            $ #
00016 ##############################################################################
00017 */
00018 
00019 #ifndef MS_DATABASEOPTIONS_HPP
00020 #define MS_DATABASEOPTIONS_HPP
00021 
00022 
00023 #include <string>
00024 #include <vector>
00025 
00026 
00027 namespace matrix_science {
00038     enum DATABASE_TYPE
00039     {
00040         AA=0, 
00041         NA=1, 
00042         SL=2, 
00043         SLREF=3, 
00044     };
00045 
00047 
00058     class MS_MASCOTRESFILE_API ms_databaseoptions
00059     {
00060         friend class ms_datfile;
00061         friend class ms_databases;
00062 
00063     public:
00065 
00070         enum {
00071             NUM_THREADS_AUTO_DETECT = -1 
00072         };
00073 
00074 
00076         ms_databaseoptions();
00077 
00079         ms_databaseoptions(const ms_databaseoptions& src);
00080 
00082         ~ms_databaseoptions();
00083 
00085         void defaultValues();
00086 
00088         void copyFrom(const ms_databaseoptions* right);
00089 
00090 #ifndef SWIG
00091 
00092         ms_databaseoptions& operator=(const ms_databaseoptions& right);
00093 #endif
00094 
00095         bool isActive() const;
00096 
00098         void setActive(const bool value);
00099 
00101         std::string getName() const;
00102 
00104         void setName(const char* name);
00105 
00107         std::string getPath() const;
00108 
00110         void setPath(const char* path);
00111 
00113         int getDBType() const;
00114 
00116         void setDBType(const int type);
00117 
00119         bool isMemoryMapFiles() const;
00120 
00122         void setMemoryMapFiles(const bool flag);
00123 
00125         int getNumberOfThreads() const;
00126 
00128         void setNumberOfThreads(const int number);
00129 
00131         bool isLockMemory() const;
00132 
00134         void setLockMemory(const bool flag);
00135 
00137         bool isLocalRefFile() const;
00138 
00140         void setLocalRefFile(const bool flag);
00141 
00143         int getAccessionParseRuleIndex() const;
00144 
00146         void setAccessionParseRuleIndex(const int index);
00147 
00149         int getDescriptionParseRuleIndex() const;
00150 
00152         void setDescriptionParseRuleIndex(const int index);
00153 
00155         int getAccessionRefParseRuleIndex() const;
00156 
00158         void setAccessionRefParseRuleIndex(const int index);
00159 
00161         int getTaxonomyParseRuleIndex() const;
00162 
00164         void setTaxonomyParseRuleIndex(const int index);
00165 
00167         bool isBlastIndexFiles() const;
00168 
00170         void setBlastIndexFiles(const bool flag);
00171 
00173         void setPreceedingComments(const std::string &str);
00174 
00176         const std::string& getPreceedingComments() const;
00177 
00178     private:
00179         std::string getStringValue() const;
00180 
00181         bool        active_;
00182         std::string name_;
00183         std::string path_;
00184         int         type_;
00185         int         __numEntries_;  // no longer used
00186         int         __uniqueID_;    // no longer used
00187         bool        mmapFiles_;
00188         bool        __useBlastIndexFiles_;    // no longer used - was also blocks
00189         int         numThreads_;
00190         bool        lockMemory_;
00191         bool        hasRefFile_;
00192         int         accessionParseRule_;
00193         int         descriptionParseRule_;
00194         int         accessionRefParseRule_;
00195         int         taxonomyParseRule_;
00196         std::string comment_;
00197     }; // class ms_databaseoptions
00198 
00200 
00224     class MS_MASCOTRESFILE_API ms_databases: public ms_customproperty
00225     {
00226         friend class ms_datfile;
00227     public:
00229         ms_databases();
00230 
00232         ms_databases(const ms_databases& src);
00233 
00235         ~ms_databases();
00236 
00238         void defaultValues();
00239 
00241         void copyFrom(const ms_databases* right);
00242 
00243 #ifndef SWIG
00244 
00245         ms_databases& operator=(const ms_databases& right);
00246 #endif
00247 
00248         bool isSectionAvailable() const;
00249 
00251         void setSectionAvailable(const bool value);
00252 
00254         int getNumberOfDatabases() const;
00255 
00257         const ms_databaseoptions* getDatabase(const int index) const;
00258 
00260         void clearDatabases();
00261 
00263         void appendDatabase(const ms_databaseoptions* item);
00264 
00266         int findDatabase(const char* dbName, const bool searchInactive = false) const;
00267 
00269         bool updateDatabaseByNumber(const int num, const ms_databaseoptions db);
00270 
00272         bool updateDatabaseByName(const char* name, const ms_databaseoptions db);
00273 
00275         bool deleteDatabaseByNumber(const int num);
00276 
00278         bool deleteDatabaseByName(const char* name);
00279 
00280 #ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
00281 #include "suppress_ms_customproperty.hpp"
00282 #endif
00283 
00284     private:
00285         void appendDatabase(const ms_databaseoptions* item, const char *propVal);
00286         void setFollowingComments(const std::string &str);
00287         const std::string& getFollowingComments() const;
00288 
00289         bool sectionAvailable_;
00290         std::vector< ms_databaseoptions* > dbases_;
00291         std::string followingComments_;
00292     }; // class ms_databases // end of config_group
00294 } // namespace matrix_science
00295 
00296 #endif // MS_DATABASEOPTIONS_HPP
00297 
00298 /*------------------------------- End of File -------------------------------*/

Copyright © 2022 Matrix Science Ltd.  All Rights Reserved. Generated on Thu Mar 31 2022 01:12:29