IMP  2.1.0
The Integrative Modeling Platform
kernel/io.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/io.h
3  * \brief Handle read/write of Model data from/to files.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_IO_H
10 #define IMPKERNEL_IO_H
11 
12 #include <IMP/kernel/kernel_config.h>
13 #include "OptimizerState.h"
14 #include "internal/utility.h"
15 #include <boost/format.hpp>
16 
17 IMPKERNEL_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
33 IMPKERNELEXPORT base::Vector<char> write_particles_to_buffer(
34  const ParticlesTemp &particles, const FloatKeys &keys);
35 //! load found attributes into the particles
36 IMPKERNELEXPORT void read_particles_from_buffer(
37  const base::Vector<char> &buffer, const ParticlesTemp &particles,
38  const FloatKeys &keys);
39 
40 /** @} */
41 
42 IMPKERNEL_END_NAMESPACE
43 
44 #endif /* IMPKERNEL_IO_H */
IMP::base::Vector< FloatKey > FloatKeys
void read_particles_from_buffer(const base::Vector< char > &buffer, const ParticlesTemp &particles, const FloatKeys &keys)
load found attributes into the particles
base::Vector< char > write_particles_to_buffer(const ParticlesTemp &particles, const FloatKeys &keys)
return a binary buffer with the data
Shared optimizer state.