CatalogEntry.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2003-2006 Rational Discovery LLC
00003 //
00004 //  @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef __RD_CATALOGENTRY_H__
00011 #define __RD_CATALOGENTRY_H__
00012 
00013 #include <iostream>
00014 #include <string>
00015 
00016 namespace RDCatalog {
00017   
00018   //! Abstract base class to be used to represent an entry in a Catalog
00019   class CatalogEntry {
00020   public:
00021     virtual ~CatalogEntry() = 0;
00022 
00023     //! sets our bit Id
00024     void setBitId(int bid) {d_bitId = bid;}; 
00025 
00026     //! returns our bit Id
00027     int getBitId() const {return d_bitId;};
00028 
00029     //! returns a text description of this entry
00030     virtual std::string getDescription() const = 0;
00031 
00032     //! serializes (pickles) to a stream
00033     virtual void toStream(std::ostream &ss) const = 0;
00034     //! returns a string with a serialized (pickled) representation
00035     virtual std::string Serialize() const = 0;
00036     //! initializes from a stream pickle
00037     virtual void initFromStream(std::istream &ss) = 0;
00038     //! initializes from a string pickle
00039     virtual void initFromString(const std::string &text) = 0;
00040 
00041 
00042     
00043   private:
00044     int d_bitId; //!< our bit Id. This needs to be signed so that we can mark uninitialized entries.
00045   };
00046 }
00047 
00048 #endif
00049