RDKit
Open-source cheminformatics and machine learning.
Loading...
Searching...
No Matches
CatalogEntry.h
Go to the documentation of this file.
1//
2// Copyright (C) 2003-2006 Rational Discovery LLC
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#include <RDGeneral/export.h>
11#ifndef __RD_CATALOGENTRY_H__
12#define __RD_CATALOGENTRY_H__
13
14#include <string>
15
16namespace RDCatalog {
17
18//! Abstract base class to be used to represent an entry in a Catalog
20 public:
21 virtual ~CatalogEntry() = 0;
22
23 //! sets our bit Id
24 void setBitId(int bid) { d_bitId = bid; }
25
26 //! returns our bit Id
27 int getBitId() const { return d_bitId; }
28
29 //! returns a text description of this entry
30 virtual std::string getDescription() const = 0;
31
32 //! serializes (pickles) to a stream
33 virtual void toStream(std::ostream &ss) const = 0;
34 //! returns a string with a serialized (pickled) representation
35 virtual std::string Serialize() const = 0;
36 //! initializes from a stream pickle
37 virtual void initFromStream(std::istream &ss) = 0;
38 //! initializes from a string pickle
39 virtual void initFromString(const std::string &text) = 0;
40
41 private:
42 int d_bitId; //!< our bit Id. This needs to be signed so that we can mark
43 // uninitialized entries.
44};
45} // namespace RDCatalog
46
47#endif
Abstract base class to be used to represent an entry in a Catalog.
virtual void initFromStream(std::istream &ss)=0
initializes from a stream pickle
int getBitId() const
returns our bit Id
virtual std::string getDescription() const =0
returns a text description of this entry
virtual void initFromString(const std::string &text)=0
initializes from a string pickle
void setBitId(int bid)
sets our bit Id
virtual void toStream(std::ostream &ss) const =0
serializes (pickles) to a stream
virtual std::string Serialize() const =0
returns a string with a serialized (pickled) representation
#define RDKIT_CATALOGS_EXPORT
Definition export.h:41