Psyllid  v1.12.4
Project 8 Data Acquisisition Software
memory_block.hh
Go to the documentation of this file.
1 /*
2  * memory_block.hh
3  *
4  * Created on: Nov 2, 2016
5  * Author: nsoblath
6  */
7 
8 #ifndef DATA_MEMORY_BLOCK_HH_
9 #define DATA_MEMORY_BLOCK_HH_
10 
11 #include "member_variables.hh"
12 
13 #include <cstdint>
14 #include <cstddef> // for size_t
15 
16 namespace psyllid
17 {
18 
20  {
21  public:
22  memory_block();
23  virtual ~memory_block();
24 
25  public:
26  void resize( size_t a_n_bytes );
27  uint8_t* block();
28  const uint8_t* block() const;
29 
30  mv_accessible( size_t, n_bytes );
31  mv_accessible( size_t, n_bytes_used );
32 
33  private:
34  uint8_t* f_block;
35  };
36 
37  inline uint8_t* memory_block::block()
38  {
39  return f_block;
40  }
41 
42  inline const uint8_t* memory_block::block() const
43  {
44  return f_block;
45  }
46 
47 } /* namespace psyllid */
48 
49 #endif /* DATA_MEMORY_BLOCK_HH_ */
void resize(size_t a_n_bytes)
Definition: memory_block.cc:27