IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
io.h
Go to the documentation of this file.
1/**
2 * \file IMP/io.h
3 * \brief Write/read the state of the particles to/from a buffer in memory.
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 *
7 */
8
9#ifndef IMPKERNEL_IO_H
10#define IMPKERNEL_IO_H
11
12#include <IMP/kernel_config.h>
13#include "OptimizerState.h"
14#include "internal/utility.h"
15#include <boost/format.hpp>
16
17IMPKERNEL_BEGIN_NAMESPACE
18
19/** \name Buffer I/O
20 Write/read the state of the particles to/from a buffer in memory.
21 \note Not all particles need to have all the attributes,
22 missing attributes will be skipped. However, the set of attributes
23 must match on the write and read particles.
24
25 \note There is no handling of architectural issues. That is, this
26 is only guaranteed to work if it is read and written on the same
27 operating system and system bit length. We could probably fix this.
28
29 \note both these methods should be considered unstable.
30 @{
31*/
32//! return a binary buffer with the data
34 const ParticlesTemp &particles, const FloatKeys &keys);
35//! load found attributes into the particles
36IMPKERNELEXPORT void read_particles_from_buffer(
37 const Vector<char> &buffer, const ParticlesTemp &particles,
38 const FloatKeys &keys);
39
40/** @} */
41
42IMPKERNEL_END_NAMESPACE
43
44#endif /* IMPKERNEL_IO_H */
Shared optimizer state.
A more IMP-like version of the std::vector.
Definition Vector.h:60
Vector< char > write_particles_to_buffer(const ParticlesTemp &particles, const FloatKeys &keys)
return a binary buffer with the data
void read_particles_from_buffer(const Vector< char > &buffer, const ParticlesTemp &particles, const FloatKeys &keys)
load found attributes into the particles
IMP::Vector< FloatKey > FloatKeys
Definition base_types.h:33