OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
Pack_stat.hpp
1 /*
2  * Pack_stat.hpp
3  *
4  * Created on: Jul 17, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef SRC_PACK_STAT_HPP_
9 #define SRC_PACK_STAT_HPP_
10 
16 {
18  size_t cnt;
19 
20 public:
21 
22  inline Unpack_stat()
23  :cnt(0)
24  {}
25 
31  inline void addOffset(size_t off)
32  {
33  cnt += off;
34  }
35 
41  inline size_t getOffset()
42  {
43  return cnt;
44  }
45 
50  inline void setOffset(size_t c)
51  {
52  cnt = c;
53  }
54 };
55 
60 class Pack_stat
61 {
63  size_t p_mark;
64 
66  size_t un_ele;
67 
68 public:
69 
70 
71  inline Pack_stat()
72  :p_mark(0),un_ele(0)
73  {}
74 
79  inline void incReq()
80  {
81  un_ele++;
82  }
83 
89  inline size_t reqPack()
90  {
91  return un_ele;
92  }
93 
99  inline void mark()
100  {
101  p_mark = un_ele;
102  }
103 
109  inline size_t getMark()
110  {
111  return p_mark;
112  }
113 };
114 
115 #endif /* SRC_PACK_STAT_HPP_ */
size_t getOffset()
Return the actual counter.
Definition: Pack_stat.hpp:41
void mark()
Mark.
Definition: Pack_stat.hpp:99
size_t p_mark
marker used to remember some position
Definition: Pack_stat.hpp:63
void setOffset(size_t c)
set the actual counter
Definition: Pack_stat.hpp:50
void incReq()
Increment the request pointer.
Definition: Pack_stat.hpp:79
void addOffset(size_t off)
Increment the offset pointer by off.
Definition: Pack_stat.hpp:31
Unpacking status object.
Definition: Pack_stat.hpp:15
size_t reqPack()
return the actual request for packing
Definition: Pack_stat.hpp:89
size_t un_ele
packing offset
Definition: Pack_stat.hpp:66
size_t cnt
offset
Definition: Pack_stat.hpp:18
Packing status object.
Definition: Pack_stat.hpp:60
size_t getMark()
Return the mark.
Definition: Pack_stat.hpp:109