11 #ifndef _RD_MOLPICKLE_H 12 #define _RD_MOLPICKLE_H 20 #include <boost/utility/binary.hpp> 40 const char *
message()
const {
return _msg.c_str(); };
47 namespace PicklerOps {
140 static unsigned int getDefaultPickleProperties();
141 static void setDefaultPickleProperties(
unsigned int);
147 static void pickleMol(
const ROMol *mol, std::ostream &ss);
148 static void pickleMol(
const ROMol *mol, std::ostream &ss,
149 unsigned int propertyFlags);
151 static void pickleMol(
const ROMol &mol, std::ostream &ss);
154 unsigned int propertyFlags) {
159 static void pickleMol(
const ROMol *mol, std::string &res);
160 static void pickleMol(
const ROMol *mol, std::string &res,
161 unsigned int propertyFlags);
162 static void pickleMol(
const ROMol &mol, std::string &res);
164 unsigned int propertyFlags) {
169 static void molFromPickle(
const std::string &
pickle,
ROMol *mol);
175 static void molFromPickle(std::istream &ss,
ROMol *mol);
182 static std::int32_t _pickleAtomData(std::ostream &tss,
const Atom *atom);
184 static void _unpickleAtomData(std::istream &tss,
Atom *atom,
int version);
186 static void _pickleQueryAtomData(std::ostream &tss,
const Atom *atom);
189 template <
typename T>
190 static void _pickle(
const ROMol *mol, std::ostream &ss,
191 unsigned int propertyFlags);
194 template <
typename T>
195 static void _pickleAtom(std::ostream &ss,
const Atom *atom);
198 template <
typename T>
199 static void _pickleBond(std::ostream &ss,
const Bond *bond,
200 std::map<int, int> &atomIdxMap);
203 template <
typename T>
204 static void _pickleSSSR(std::ostream &ss,
const RingInfo *ringInfo,
205 std::map<int, int> &atomIdxMap);
208 template <
typename T>
209 static void _pickleSubstanceGroup(std::ostream &ss,
const SubstanceGroup &sgroup,
210 std::map<int, int> &atomIdxMap,
211 std::map<int, int> &bondIdxMap);
214 template <
typename T>
215 static void _pickleStereo(std::ostream &ss,
216 const std::vector<StereoGroup> &groups,
217 std::map<int, int> &atomIdxMap);
220 template <
typename T>
221 static void _pickleConformer(std::ostream &ss,
const Conformer *conf);
224 template <
typename T>
225 static void _depickle(std::istream &ss,
ROMol *mol,
int version,
230 template <
typename T>
231 static Atom *_addAtomFromPickle(std::istream &ss,
ROMol *mol,
233 bool directMap =
false);
236 template <
typename T>
237 static Bond *_addBondFromPickle(std::istream &ss,
ROMol *mol,
int version,
238 bool directMap =
false);
242 template <
typename T>
243 static void _addRingInfoFromPickle(std::istream &ss,
ROMol *mol,
int version,
244 bool directMap =
false);
247 template <
typename T>
248 static SubstanceGroup _getSubstanceGroupFromPickle(std::istream &ss,
ROMol *mol,
int version);
250 template <
typename T>
251 static void _depickleStereo(std::istream &ss,
ROMol *mol,
int version);
254 template <
typename T>
255 static Conformer *_conformerFromPickle(std::istream &ss,
int version);
258 static void _pickleProperties(std::ostream &ss,
const RDProps &props,
259 unsigned int pickleFlags);
261 static void _unpickleProperties(std::istream &ss,
RDProps &props);
264 static void _pickleV1(
const ROMol *mol, std::ostream &ss);
266 static void _depickleV1(std::istream &ss,
ROMol *mol);
268 static void _addAtomFromPickleV1(std::istream &ss,
ROMol *mol);
270 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)
The class for representing SubstanceGroups.
static void pickleMol(const ROMol &mol, std::string &res, unsigned int propertyFlags)
Tags
mark the endian-ness of the pickle
std::vector< std::shared_ptr< const CustomPropHandler > > CustomPropHandlerVec
static const std::int32_t versionMinor
mark the pickle minor version
static const std::int32_t versionMajor
mark the pickle major 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 const std::int32_t versionPatch
mark the pickle patch version
static void molFromPickle(const std::string &pickle, ROMol &mol)
static const std::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.