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 <iostream>
15#include <string>
16
17namespace RDCatalog {
18
19//! Abstract base class to be used to represent an entry in a Catalog
21 public:
22 virtual ~CatalogEntry() = 0;
23
24 //! sets our bit Id
25 void setBitId(int bid) { d_bitId = bid; }
26
27 //! returns our bit Id
28 int getBitId() const { return d_bitId; }
29
30 //! returns a text description of this entry
31 virtual std::string getDescription() const = 0;
32
33 //! serializes (pickles) to a stream
34 virtual void toStream(std::ostream &ss) const = 0;
35 //! returns a string with a serialized (pickled) representation
36 virtual std::string Serialize() const = 0;
37 //! initializes from a stream pickle
38 virtual void initFromStream(std::istream &ss) = 0;
39 //! initializes from a string pickle
40 virtual void initFromString(const std::string &text) = 0;
41
42 private:
43 int d_bitId; //!< our bit Id. This needs to be signed so that we can mark
44 // uninitialized entries.
45};
46} // namespace RDCatalog
47
48#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