pack_stream.h
1 /*
2  @copyright Russell Standish 2000-2013
3  @author Russell Standish
4  This file is part of Classdesc
5 
6  Open source licensed under the MIT license. See LICENSE for details.
7 */
8 
9 #ifndef PACK_STREAM_H
10 #define PACK_STREAM_H
11 #include "pack_base.h"
12 
13 namespace classdesc
14 {
15  template <class T>
16  pack_t& operator<<(pack_t& y,const T&x)
17  {::pack(y,string(),x); return y;}
18 
19  template <class T>
20  pack_t& operator>>(pack_t& y,T&x)
21  {::unpack(y,string(),x); return y;}
22 
23 }
24 
25 #ifdef CLASSDESCMP_H
26 namespace classdesc {
27  template <class T> inline MPIbuf& MPIbuf::operator<<(const T&x)
28  {::pack((MPIbuf_base&)*this,string(),const_cast<T&>(x)); return *this;}
29 }
30 
31 #endif
32 #endif
serialisation descriptor
void pack(pack_t &targ, const string &desc, is_treenode dum, const T *const &arg)
serialise a tree (or DAG)
Definition: pack_graph.h:28
Contains definitions related to classdesc functionality.
Definition: arrays.h:2514
void unpack(unpack_t &targ, const string &desc, is_treenode dum, T *&arg)
unserialise a tree.
Definition: pack_graph.h:44