RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
SubstructureResults.h
Go to the documentation of this file.
1//
2// Copyright (C) David Cosgrove 2024.
3//
4// @@ All Rights Reserved @@
5// This file is part of the RDKit.
6// The contents are covered by the terms of the BSD license
7// which is included in the file license.txt, found at the root
8// of the RDKit source tree.
9//
10
11#ifndef RDKIT_SYNTHONSPACE_SUBSTRUCTURERESULTS_H
12#define RDKIT_SYNTHONSPACE_SUBSTRUCTURERESULTS_H
13
14#include <GraphMol/ROMol.h>
15
18 public:
19 explicit SubstructureResults() : d_maxNumResults(0) {}
20 SubstructureResults(std::vector<std::unique_ptr<ROMol>> &&mols,
21 size_t maxNumRes);
25
28
29 /*!
30 * Returns the upper bound on the number of results the search might return.
31 * There may be fewer than this in practice for several reasons such as
32 * duplicate reagent sets being removed or the final product not matching the
33 * query even though the synthons suggested it would.
34 *
35 * @return int
36 */
37 size_t getMaxNumResults() const { return d_maxNumResults; }
38 /*!
39 * Returns the hits from the search. Not necessarily all those possible,
40 * just the maximum number requested.
41 *
42 * @return std::vector<std::unique_ptr<ROMol>>
43 */
44 const std::vector<std::unique_ptr<ROMol>> &getHitMolecules() const {
45 return d_hitMolecules;
46 }
47
48 private:
49 std::vector<std::unique_ptr<ROMol>> d_hitMolecules;
50 size_t d_maxNumResults;
51};
52
54 std::vector<std::unique_ptr<ROMol>> &&mols, size_t maxNumRes)
55 : d_maxNumResults(maxNumRes) {
56 d_hitMolecules = std::move(mols);
57 mols.clear();
58}
59
62 : d_maxNumResults(other.d_maxNumResults) {
63 for (const auto &hm : other.d_hitMolecules) {
64 d_hitMolecules.emplace_back(new ROMol(*hm));
65 }
66}
67} // namespace RDKit::SynthonSpaceSearch
68
69#endif // RDKIT_SUBSTRUCTURERESULTS_H
Defines the primary molecule class ROMol as well as associated typedefs.
SubstructureResults & operator=(SubstructureResults &&other)=default
const std::vector< std::unique_ptr< ROMol > > & getHitMolecules() const
SubstructureResults(SubstructureResults &&other)=default
SubstructureResults & operator=(const SubstructureResults &other)
#define RDKIT_SYNTHONSPACESEARCH_EXPORT
Definition export.h:545
bool rdvalue_is(const RDValue_cast_t)