11 #ifndef _RD_MOLPICKLE_H 12 #define _RD_MOLPICKLE_H 19 #include <boost/utility/binary.hpp> 28 #include <boost/cstdint.hpp> 39 const char *
message()
const {
return _msg.c_str(); };
46 namespace PicklerOps {
138 static unsigned int getDefaultPickleProperties();
139 static void setDefaultPickleProperties(
unsigned int);
142 static void pickleMol(
const ROMol *mol, std::ostream &ss);
143 static void pickleMol(
const ROMol *mol, std::ostream &ss,
144 unsigned int propertyFlags);
146 static void pickleMol(
const ROMol &mol, std::ostream &ss);
149 unsigned int propertyFlags) {
154 static void pickleMol(
const ROMol *mol, std::string &res);
155 static void pickleMol(
const ROMol *mol, std::string &res,
156 unsigned int propertyFlags);
157 static void pickleMol(
const ROMol &mol, std::string &res);
159 unsigned int propertyFlags) {
164 static void molFromPickle(
const std::string &
pickle,
ROMol *mol);
170 static void molFromPickle(std::istream &ss,
ROMol *mol);
177 static boost::int32_t _pickleAtomData(std::ostream &tss,
const Atom *atom);
179 static void _unpickleAtomData(std::istream &tss,
Atom *atom,
int version);
181 static void _pickleQueryAtomData(std::ostream &tss,
const Atom *atom);
184 template <
typename T>
185 static void _pickle(
const ROMol *mol, std::ostream &ss,
186 unsigned int propertyFlags);
189 template <
typename T>
190 static void _pickleAtom(std::ostream &ss,
const Atom *atom);
193 template <
typename T>
194 static void _pickleBond(std::ostream &ss,
const Bond *bond,
195 std::map<int, int> &atomIdxMap);
198 template <
typename T>
199 static void _pickleSSSR(std::ostream &ss,
const RingInfo *ringInfo,
200 std::map<int, int> &atomIdxMap);
203 template <
typename T>
204 static void _pickleStereo(std::ostream &ss,
205 const std::vector<StereoGroup> &groups,
206 std::map<int, int> &atomIdxMap);
209 template <
typename T>
210 static void _pickleConformer(std::ostream &ss,
const Conformer *conf);
213 template <
typename T>
214 static void _depickle(std::istream &ss,
ROMol *mol,
int version,
219 template <
typename T>
220 static Atom *_addAtomFromPickle(std::istream &ss,
ROMol *mol,
222 bool directMap =
false);
225 template <
typename T>
226 static Bond *_addBondFromPickle(std::istream &ss,
ROMol *mol,
int version,
227 bool directMap =
false);
231 template <
typename T>
232 static void _addRingInfoFromPickle(std::istream &ss,
ROMol *mol,
int version,
233 bool directMap =
false);
235 template <
typename T>
236 static void _depickleStereo(std::istream &ss,
ROMol *mol,
int version);
239 template <
typename T>
240 static Conformer *_conformerFromPickle(std::istream &ss,
int version);
243 static void _pickleProperties(std::ostream &ss,
const RDProps &props,
244 unsigned int pickleFlags);
246 static void _unpickleProperties(std::istream &ss,
RDProps &props);
249 static void _pickleV1(
const ROMol *mol, std::ostream &ss);
251 static void _depickleV1(std::istream &ss,
ROMol *mol);
253 static void _addAtomFromPickleV1(std::istream &ss,
ROMol *mol);
255 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 versionMajor
mark the pickle major version
static const boost::int32_t versionMinor
mark the pickle minor version
static const boost::int32_t versionPatch
mark the pickle patch version
RDKIT_CHEMREACTIONS_EXPORT void pickle(const boost::shared_ptr< EnumerationStrategyBase > &enumerator, std::ostream &ss)
pickles a EnumerationStrategy and adds the results to a stream ss
const char * message() const
#define RDKIT_GRAPHMOL_EXPORT
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.