Loading...
Searching...
No Matches
SequenceRule.h
Go to the documentation of this file.
//
//
// Copyright (C) 2020 Schrödinger, LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#pragma once
#include <stdexcept>
#include <memory>
#include <vector>
#include "../CIPLabeler.h"
#include "../Descriptor.h"
#include "../Edge.h"
#include "../Node.h"
#include "../Sort.h"
#include "Pairlist.h"
namespace RDKit {
namespace CIPLabeler {
class CIPMol;
namespace {
template <typename T>
inline int three_way_comparison(const T &x, const T &y) {
return x < y ? -1 : (x == y ? 0 : 1);
}
} // namespace
class SequenceRule {
public:
SequenceRule();
virtual ~SequenceRule();
Descriptor getBondLabel(const Edge *edge) const;
int getComparision(const Edge *a, const Edge *b) const;
virtual int getComparision(const Edge *a, const Edge *b, bool deep) const;
virtual const Sort *getSorter() const;
int recursiveCompare(const Edge *a, const Edge *b) const;
void setSorter(const Sort *sorter);
Priority sort(const Node *node, std::vector<Edge *> &edges, bool deep) const;
Priority sort(const Node *node, std::vector<Edge *> &edges) const;
virtual int compare(const Edge *a, const Edge *b) const = 0;
protected:
std::unique_ptr<const Sort> dp_sorter = nullptr;
private:
bool areUpEdges(Node *aNode, Node *bNode, Edge *aEdge, Edge *bEdge) const;
};
} // namespace CIPLabeler
} // namespace RDKit
Pairlist.h
RDKit::CIPLabeler::Edge
Definition Edge.h:23
RDKit::CIPLabeler::Node
Definition Node.h:27
RDKit::CIPLabeler::Priority
Definition Priority.h:21
RDKit::CIPLabeler::SequenceRule
Definition SequenceRule.h:36
RDKit::CIPLabeler::SequenceRule::recursiveCompare
int recursiveCompare(const Edge *a, const Edge *b) const
RDKit::CIPLabeler::SequenceRule::~SequenceRule
virtual ~SequenceRule()
RDKit::CIPLabeler::SequenceRule::getComparision
int getComparision(const Edge *a, const Edge *b) const
RDKit::CIPLabeler::SequenceRule::getSorter
virtual const Sort * getSorter() const
RDKit::CIPLabeler::SequenceRule::getBondLabel
Descriptor getBondLabel(const Edge *edge) const
RDKit::CIPLabeler::SequenceRule::getComparision
virtual int getComparision(const Edge *a, const Edge *b, bool deep) const
RDKit::CIPLabeler::SequenceRule::dp_sorter
std::unique_ptr< const Sort > dp_sorter
Definition SequenceRule.h:61
RDKit::CIPLabeler::SequenceRule::compare
virtual int compare(const Edge *a, const Edge *b) const =0
RDKit::CIPLabeler::SequenceRule::sort
Priority sort(const Node *node, std::vector< Edge * > &edges, bool deep) const
RDKit::CIPLabeler::SequenceRule::sort
Priority sort(const Node *node, std::vector< Edge * > &edges) const
RDKit::CIPLabeler::SequenceRule::setSorter
void setSorter(const Sort *sorter)
RDKit::CIPLabeler::SequenceRule::SequenceRule
SequenceRule()
RDKit::CIPLabeler::Sort
Definition Sort.h:28
RDKit::CIPLabeler::Descriptor
Descriptor
Definition Descriptor.h:25
RDKit
Std stuff.
Definition Abbreviations.h:19
RDKit::rdvalue_is
bool rdvalue_is(const RDValue_cast_t)
Definition RDValue-doublemagic.h:372