Chemical Data Processing Library C++ API - Version 1.1.1
ScreeningDBCreator.hpp
Go to the documentation of this file.
1 /*
2  * ScreeningDBCreator.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_PHARM_SCREENINGDBCREATOR_HPP
30 #define CDPL_PHARM_SCREENINGDBCREATOR_HPP
31 
32 #include <string>
33 #include <cstddef>
34 #include <memory>
35 #include <functional>
36 
37 #include "CDPL/Pharm/APIPrefix.hpp"
38 
39 
40 namespace CDPL
41 {
42 
43  namespace Chem
44  {
45 
46  class MolecularGraph;
47  }
48 
49  namespace Pharm
50  {
51 
52  class ScreeningDBAccessor;
53 
58  {
59 
60  public:
61  typedef std::shared_ptr<ScreeningDBCreator> SharedPointer;
62 
63  typedef std::function<bool(double)> ProgressCallbackFunction;
64 
65  enum Mode
66  {
67 
70  APPEND
71  };
72 
76  virtual ~ScreeningDBCreator() {}
77 
78  virtual void open(const std::string& name, Mode mode = CREATE, bool allow_dup_entries = true) = 0;
79 
80  virtual void close() = 0;
81 
82  virtual Mode getMode() const = 0;
83 
84  virtual bool allowDuplicateEntries() const = 0;
85 
86  virtual bool process(const Chem::MolecularGraph& molgraph) = 0;
87 
88  virtual bool merge(const ScreeningDBAccessor& db_acc, const ProgressCallbackFunction& func) = 0;
89 
90  virtual const std::string& getDatabaseName() const = 0;
91 
92  virtual std::size_t getNumProcessed() const = 0;
93 
94  virtual std::size_t getNumRejected() const = 0;
95 
96  virtual std::size_t getNumDeleted() const = 0;
97 
98  virtual std::size_t getNumInserted() const = 0;
99 
100  protected:
102  {
103  return *this;
104  }
105  };
106  } // namespace Pharm
107 } // namespace CDPL
108 
109 #endif // CDPL_PHARM_SCREENINGDBCREATOR_HPP
APIPrefix.hpp
Definition of the preprocessor macro CDPL_PHARM_API.
CDPL_PHARM_API
#define CDPL_PHARM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Pharm::ScreeningDBCreator::open
virtual void open(const std::string &name, Mode mode=CREATE, bool allow_dup_entries=true)=0
CDPL::Pharm::ScreeningDBCreator::operator=
ScreeningDBCreator & operator=(const ScreeningDBCreator &)
Definition: ScreeningDBCreator.hpp:101
CDPL::Pharm::ScreeningDBCreator::Mode
Mode
Definition: ScreeningDBCreator.hpp:66
CDPL::Pharm::ScreeningDBCreator::SharedPointer
std::shared_ptr< ScreeningDBCreator > SharedPointer
Definition: ScreeningDBCreator.hpp:61
CDPL::Pharm::ScreeningDBCreator::close
virtual void close()=0
CDPL::Pharm::ScreeningDBCreator::allowDuplicateEntries
virtual bool allowDuplicateEntries() const =0
CDPL::Pharm::ScreeningDBCreator::process
virtual bool process(const Chem::MolecularGraph &molgraph)=0
CDPL::Pharm::ScreeningDBCreator::ProgressCallbackFunction
std::function< bool(double)> ProgressCallbackFunction
Definition: ScreeningDBCreator.hpp:63
CDPL::Pharm::ScreeningDBCreator::getNumDeleted
virtual std::size_t getNumDeleted() const =0
CDPL::Pharm::ScreeningDBCreator::getMode
virtual Mode getMode() const =0
bool
CDPL::Chem::MolecularGraph
MolecularGraph.
Definition: MolecularGraph.hpp:52
CDPL::Pharm::ScreeningDBCreator::getDatabaseName
virtual const std::string & getDatabaseName() const =0
CDPL::Pharm::ScreeningDBCreator::UPDATE
@ UPDATE
Definition: ScreeningDBCreator.hpp:69
CDPL::Pharm::ScreeningDBCreator
A class for the creation of optimized pharmacophore screening databases.
Definition: ScreeningDBCreator.hpp:58
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Pharm::ScreeningDBCreator::CREATE
@ CREATE
Definition: ScreeningDBCreator.hpp:68
CDPL::Pharm::ScreeningDBCreator::getNumProcessed
virtual std::size_t getNumProcessed() const =0
CDPL::Pharm::ScreeningDBCreator::getNumInserted
virtual std::size_t getNumInserted() const =0
CDPL::Pharm::ScreeningDBAccessor
A class for accessing the data stored in pharmacophore screening databases.
Definition: ScreeningDBAccessor.hpp:58
CDPL::Pharm::ScreeningDBCreator::getNumRejected
virtual std::size_t getNumRejected() const =0
CDPL::Pharm::ScreeningDBCreator::~ScreeningDBCreator
virtual ~ScreeningDBCreator()
Virtual destructor.
Definition: ScreeningDBCreator.hpp:76
CDPL::Pharm::ScreeningDBCreator::merge
virtual bool merge(const ScreeningDBAccessor &db_acc, const ProgressCallbackFunction &func)=0