11 #ifndef _RD_MOLPICKLE_H
12 #define _RD_MOLPICKLE_H
20 #include <boost/utility/binary.hpp>
40 const char *
what() const noexcept
override {
return _msg.c_str(); };
47 namespace PicklerOps {
154 unsigned int propertyFlags);
159 unsigned int propertyFlags) {
166 unsigned int propertyFlags);
169 unsigned int propertyFlags) {
187 static std::int32_t _pickleAtomData(std::ostream &tss,
const Atom *atom);
189 static void _unpickleAtomData(std::istream &tss,
Atom *atom,
int version);
191 static void _pickleQueryAtomData(std::ostream &tss,
const Atom *atom);
194 template <
typename T>
195 static void _pickle(
const ROMol *mol, std::ostream &ss,
196 unsigned int propertyFlags);
199 template <
typename T>
200 static void _pickleAtom(std::ostream &ss,
const Atom *atom);
203 template <
typename T>
204 static void _pickleBond(std::ostream &ss,
const Bond *bond,
205 std::map<int, int> &atomIdxMap);
208 template <
typename T>
209 static void _pickleSSSR(std::ostream &ss,
const RingInfo *ringInfo,
210 std::map<int, int> &atomIdxMap);
213 template <
typename T>
214 static void _pickleSubstanceGroup(std::ostream &ss,
216 std::map<int, int> &atomIdxMap,
217 std::map<int, int> &bondIdxMap);
220 template <
typename T>
221 static void _pickleStereo(std::ostream &ss,
222 const std::vector<StereoGroup> &groups,
223 std::map<int, int> &atomIdxMap);
226 template <
typename T,
typename C>
227 static void _pickleConformer(std::ostream &ss,
const Conformer *conf);
230 template <
typename T>
231 static void _depickle(std::istream &ss,
ROMol *mol,
int version,
236 template <
typename T>
237 static Atom *_addAtomFromPickle(std::istream &ss,
ROMol *mol,
239 bool directMap =
false);
242 template <
typename T>
243 static Bond *_addBondFromPickle(std::istream &ss,
ROMol *mol,
int version,
244 bool directMap =
false);
248 template <
typename T>
249 static void _addRingInfoFromPickle(std::istream &ss,
ROMol *mol,
int version,
250 bool directMap =
false);
253 template <
typename T>
254 static SubstanceGroup _getSubstanceGroupFromPickle(std::istream &ss,
255 ROMol *mol,
int version);
257 template <
typename T>
258 static void _depickleStereo(std::istream &ss,
ROMol *mol,
int version);
261 template <
typename T,
typename C>
262 static Conformer *_conformerFromPickle(std::istream &ss,
int version);
265 static void _pickleProperties(std::ostream &ss,
const RDProps &props,
266 unsigned int pickleFlags);
268 static void _unpickleProperties(std::istream &ss,
RDProps &props);
271 static void _pickleV1(
const ROMol *mol, std::ostream &ss);
273 static void _depickleV1(std::istream &ss,
ROMol *mol);
275 static void _addAtomFromPickleV1(std::istream &ss,
ROMol *mol);
277 static void _addBondFromPickleV1(std::istream &ss,
ROMol *mol);
Defines the Atom class and associated typedefs.
The class for representing atoms.
class for representing a bond
used to indicate exceptions whilst pickling (serializing) molecules
~MolPicklerException() noexcept
const char * what() const noexcept override
MolPicklerException(const std::string msg)
MolPicklerException(const char *msg)
handles pickling (serializing) molecules
static const std::int32_t endianId
static void molFromPickle(std::istream &ss, ROMol *mol)
constructs a molecule from a pickle stored in a stream
static void pickleMol(const ROMol *mol, std::string &res, unsigned int propertyFlags)
static void molFromPickle(const std::string &pickle, ROMol *mol)
constructs a molecule from a pickle stored in a string
@ ATOM_PDB_RESIDUE_TEMPFACTOR
@ ATOM_PDB_RESIDUE_OCCUPANCY
@ ATOM_PDB_RESIDUE_SERIALNUMBER
@ ATOM_PDB_RESIDUE_INSERTIONCODE
@ ATOM_PDB_RESIDUE_RESIDUENUMBER
@ ATOM_PDB_RESIDUE_SECONDARYSTRUCTURE
@ ATOM_PDB_RESIDUE_SEGMENTNUMBER
@ ATOM_PDB_RESIDUE_RESIDUENAME
@ ATOM_PDB_RESIDUE_ALTLOC
@ ATOM_PDB_RESIDUE_CHAINID
@ ATOM_PDB_RESIDUE_ISHETEROATOM
static void pickleMol(const ROMol &mol, std::ostream &ss)
static void pickleMol(const ROMol &mol, std::string &res, unsigned int propertyFlags)
static void pickleMol(const ROMol *mol, std::ostream &ss, unsigned int propertyFlags)
static void molFromPickle(const std::string &pickle, ROMol &mol)
static const CustomPropHandlerVec & getCustomPropHandlers()
static void setDefaultPickleProperties(unsigned int)
static const std::int32_t versionMajor
mark the pickle major version
static const std::int32_t versionMinor
mark the pickle minor version
static void molFromPickle(std::istream &ss, ROMol &mol)
static void pickleMol(const ROMol &mol, std::ostream &ss, unsigned int propertyFlags)
static void pickleMol(const ROMol *mol, std::ostream &ss)
pickles a molecule and sends the results to stream ss
static void pickleMol(const ROMol *mol, std::string &res)
pickles a molecule and adds the results to string res
static unsigned int getDefaultPickleProperties()
static void addCustomPropHandler(const CustomPropHandler &handler)
static const std::int32_t versionPatch
mark the pickle patch version
static void pickleMol(const ROMol &mol, std::string &res)
A class to store information about a molecule's rings.
The class for representing SubstanceGroups.
#define RDKIT_GRAPHMOL_EXPORT
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
std::vector< std::shared_ptr< const CustomPropHandler > > CustomPropHandlerVec