acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
raw_block.h
1#pragma once
2
3
4//#include "acme/prototype/prototype/block.h"
5
6
7
8
9template < typename RAW_BLOCK >
11{
12
13 using raw_RAW_BLOCK = RAW_BLOCK;
14
15 const RAW_BLOCK * data() const { return (const RAW_BLOCK *)this; }
16 RAW_BLOCK * data() { return (RAW_BLOCK *)this; }
17 memsize size() const { return (memsize) sizeof(RAW_BLOCK); }
18
19 RAW_BLOCK & operator = (const block & block)
20 {
21
22 if ((const void *) this != (const void *) & block)
23 {
24
25 memory_copy(this, block.data(), minimum(sizeof(*this), block.size()));
26
27 }
28
29 return (RAW_BLOCK &) *this;
30
31 }
32
33 ::block block() const { return ::block(data(), size()); }
34
35 inline void clear() { ::zero(data(), size()); }
36
37 bool operator == (const RAW_BLOCK & rectangle) const {return memory_order(this, &rectangle, sizeof(RAW_BLOCK)) == 0; }
38
39
40};
41
42
43
44
45
46//#define __memory(MEMORY) struct CLASS_DECL_EXPORT MEMORY : public memory_template < MEMORY >
47
48
49
50
51
Definition raw_block.h:11