Loading [MathJax]/extensions/tex2jax.js
Chemical Data Processing Library C++ API - Version 1.3.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SubstructureEditor.hpp
Go to the documentation of this file.
1 /*
2  * SubstructureEditor.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_CHEM_SUBSTRUCTUREEDITOR_HPP
30 #define CDPL_CHEM_SUBSTRUCTUREEDITOR_HPP
31 
32 #include <cstddef>
33 #include <vector>
34 #include <memory>
35 
36 #include "CDPL/Chem/APIPrefix.hpp"
39 #include "CDPL/Util/BitSet.hpp"
41 
42 
43 namespace CDPL
44 {
45 
46  namespace Chem
47  {
48 
49  class Molecule;
50 
56  {
57 
58  public:
59  typedef std::shared_ptr<SubstructureEditor> SharedPointer;
60 
65 
71 
76 
82 
83 
84 
90 
95 
100 
107 
108  private:
109  struct SubstructPattern
110  {
111 
112  SubstructPattern(const Chem::MolecularGraph::SharedPointer& ptn, bool unique_mpgs):
113  pattern(ptn), subSearch(new Chem::SubstructureSearch(*ptn))
114  {
115  subSearch->uniqueMappingsOnly(unique_mpgs);
116  }
117 
120  };
121 
122  typedef std::vector<SubstructPattern> SubstructPatternList;
123 
124  const Chem::MolecularGraph* molGraph;
125  SubstructPatternList searchPatterns;
126  SubstructPatternList excludePatterns;
127  };
128  } // namespace Chem
129 } // namespace CDPL
130 
131 #endif // CDPL_CHEM_SUBSTRUCTUREEDITOR_HPP
Definition of the type CDPL::Util::BitSet.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Chem::MolecularGraph.
Definition of the class CDPL::Util::ObjectStack.
Definition of the class CDPL::Chem::SubstructureSearch.
MolecularGraph.
Definition: MolecularGraph.hpp:52
std::shared_ptr< MolecularGraph > SharedPointer
A reference-counted smart pointer [SHPTR] for dynamically allocated MolecularGraph instances.
Definition: MolecularGraph.hpp:58
SubstructureEditor.
Definition: SubstructureEditor.hpp:56
SubstructureEditor()
Constructs the SubstructureEditor instance.
SubstructureEditor(const SubstructureEditor &editor)
Constructs a copy of the SubstructureEditor instance editor.
std::shared_ptr< SubstructureEditor > SharedPointer
Definition: SubstructureEditor.hpp:59
void addSearchPattern(const Chem::MolecularGraph::SharedPointer &pattern)
Appends a new substructure search pattern to the current set of patterns.
SubstructureEditor & operator=(const SubstructureEditor &gen)
Copies the state of the SubstructureEditor instance gen.
void clearSearchPatterns()
Clears the current set of substructuresearch patterns.
void clearExcludePatterns()
Clears the current set of substructure exclude patterns.
void addExcludePattern(const Chem::MolecularGraph::SharedPointer &pattern)
Appends a new substructure exclude pattern to the current set of patterns.
SubstructureSearch.
Definition: SubstructureSearch.hpp:64
std::shared_ptr< SubstructureSearch > SharedPointer
Definition: SubstructureSearch.hpp:73
The namespace of the Chemical Data Processing Library.