RDKit
Open-source cheminformatics and machine learning.
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 #ifndef __RD_CATALOGENTRY_H__
11 #define __RD_CATALOGENTRY_H__
12 
13 #include <iostream>
14 #include <string>
15 
16 namespace RDCatalog {
17 
18 //! Abstract base class to be used to represent an entry in a Catalog
19 class CatalogEntry {
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 }
46 
47 #endif
virtual void initFromString(const std::string &text)=0
initializes from a string pickle
virtual std::string getDescription() const =0
returns a text description of this entry
void setBitId(int bid)
sets our bit Id
Definition: CatalogEntry.h:24
virtual void initFromStream(std::istream &ss)=0
initializes from a stream pickle
virtual void toStream(std::ostream &ss) const =0
serializes (pickles) to a stream
Abstract base class to be used to represent an entry in a Catalog.
Definition: CatalogEntry.h:19
int getBitId() const
returns our bit Id
Definition: CatalogEntry.h:27
virtual std::string Serialize() const =0
returns a string with a serialized (pickled) representation