libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
buffermapflags.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <promeki/namespace.h>
14
15PROMEKI_NAMESPACE_BEGIN
16
26enum class MapFlags {
27 None = 0,
28 Read = 1,
29 Write = 2,
30 ReadWrite = Read | Write
31};
32
34inline MapFlags operator|(MapFlags a, MapFlags b) {
35 return static_cast<MapFlags>(static_cast<int>(a) | static_cast<int>(b));
36}
37
39inline MapFlags operator&(MapFlags a, MapFlags b) {
40 return static_cast<MapFlags>(static_cast<int>(a) & static_cast<int>(b));
41}
42
49inline bool hasMapFlag(MapFlags value, MapFlags flag) {
50 return (static_cast<int>(value) & static_cast<int>(flag)) != 0;
51}
52
53PROMEKI_NAMESPACE_END
54
55#endif // PROMEKI_ENABLE_CORE