IMP  2.0.1
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 "file.h"
14 #include "OptimizerState.h"
15 #include "internal/utility.h"
16 #include <boost/format.hpp>
17 
18 IMPKERNEL_BEGIN_NAMESPACE
19 
20 /** \name Buffer I/O
21  Write/read the state of the particles to/from a buffer in memory.
22  \note Not all particles need to have all the attributes,
23  missing attributes will be skipped. However, the set of attributes
24  must match on the write and read particles.
25 
26  \note There is no handling of architectural issues. That is, this
27  is only guaranteed to work if it is read and written on the same
28  operating system and system bit length. We could probably fix this.
29 
30  \note both these methods should be considered unstable.
31  @{
32 */
33 //! return a binary buffer with the data
34 IMPKERNELEXPORT base::Vector<char>
35 write_particles_to_buffer(const ParticlesTemp &particles,
36  const FloatKeys &keys);
37 //! load found attributes into the particles
38 IMPKERNELEXPORT void
39 read_particles_from_buffer( const base::Vector<char> &buffer,
40  const ParticlesTemp &particles,
41  const FloatKeys &keys);
42 
43 /** @} */
44 
45 IMPKERNEL_END_NAMESPACE
46 
47 #endif /* IMPKERNEL_IO_H */