10 #ifndef _RD_MOLPICKLE_H 11 #define _RD_MOLPICKLE_H 18 #include <boost/utility/binary.hpp> 27 #include <boost/cstdint.hpp> 38 const char *
message()
const {
return _msg.c_str(); };
45 namespace PicklerOps {
134 static unsigned int getDefaultPickleProperties();
135 static void setDefaultPickleProperties(
unsigned int);
138 static void pickleMol(
const ROMol *mol, std::ostream &ss);
139 static void pickleMol(
const ROMol *mol, std::ostream &ss,
140 unsigned int propertyFlags);
142 static void pickleMol(
const ROMol &mol, std::ostream &ss);
145 unsigned int propertyFlags) {
150 static void pickleMol(
const ROMol *mol, std::string &res);
151 static void pickleMol(
const ROMol *mol, std::string &res,
152 unsigned int propertyFlags);
153 static void pickleMol(
const ROMol &mol, std::string &res);
155 unsigned int propertyFlags) {
160 static void molFromPickle(
const std::string &
pickle,
ROMol *mol);
166 static void molFromPickle(std::istream &ss,
ROMol *mol);
173 static boost::int32_t _pickleAtomData(std::ostream &tss,
const Atom *atom);
175 static void _unpickleAtomData(std::istream &tss,
Atom *atom,
int version);
177 static void _pickleQueryAtomData(std::ostream &tss,
const Atom *atom);
180 template <
typename T>
181 static void _pickle(
const ROMol *mol, std::ostream &ss,
182 unsigned int propertyFlags);
185 template <
typename T>
186 static void _pickleAtom(std::ostream &ss,
const Atom *atom);
189 template <
typename T>
190 static void _pickleBond(std::ostream &ss,
const Bond *bond,
191 std::map<int, int> &atomIdxMap);
194 template <
typename T>
195 static void _pickleSSSR(std::ostream &ss,
const RingInfo *ringInfo,
196 std::map<int, int> &atomIdxMap);
199 template <
typename T>
200 static void _pickleConformer(std::ostream &ss,
const Conformer *conf);
203 template <
typename T>
204 static void _depickle(std::istream &ss,
ROMol *mol,
int version,
209 template <
typename T>
210 static Atom *_addAtomFromPickle(std::istream &ss,
ROMol *mol,
212 bool directMap =
false);
215 template <
typename T>
216 static Bond *_addBondFromPickle(std::istream &ss,
ROMol *mol,
int version,
217 bool directMap =
false);
221 template <
typename T>
222 static void _addRingInfoFromPickle(std::istream &ss,
ROMol *mol,
int version,
223 bool directMap =
false);
226 template <
typename T>
227 static Conformer *_conformerFromPickle(std::istream &ss,
int version);
230 static void _pickleProperties(std::ostream &ss,
const RDProps &props,
231 unsigned int pickleFlags);
233 static void _unpickleProperties(std::istream &ss,
RDProps &props);
236 static void _pickleV1(
const ROMol *mol, std::ostream &ss);
238 static void _depickleV1(std::istream &ss,
ROMol *mol);
240 static void _addAtomFromPickleV1(std::istream &ss,
ROMol *mol);
242 static void _addBondFromPickleV1(std::istream &ss,
ROMol *mol);
static void pickleMol(const ROMol *mol, std::ostream &ss)
pickles a molecule and sends the results to stream ss
MolPicklerException(const char *msg)
static void pickleMol(const ROMol &mol, std::string &res, unsigned int propertyFlags)
Tags
mark the endian-ness of the pickle
static const boost::int32_t versionPatch
mark the pickle version
ROMol is a molecule class that is intended to have a fixed topology.
const char * message() const
static void molFromPickle(const std::string &pickle, ROMol &mol)
static const boost::int32_t endianId
A class to store information about a molecule's rings.
used to indicate exceptions whilst pickling (serializing) molecules
class for representing a bond
MolPicklerException(const std::string msg)
handles pickling (serializing) molecules
static void molFromPickle(const std::string &pickle, ROMol *mol)
constructs a molecule from a pickle stored in a string
static void molFromPickle(std::istream &ss, ROMol &mol)
Defines the Atom class and associated typedefs.
static void pickleMol(const ROMol &mol, std::ostream &ss, unsigned int propertyFlags)
The class for representing atoms.
void pickle(const boost::shared_ptr< EnumerationStrategyBase > &enumerator, std::ostream &ss)
pickles a EnumerationStrategy and adds the results to a stream ss