OmniSciDB
a5dc49c757
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
InSituFlags.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 HEAVY.AI, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#pragma once
18
19
#include "
Shared/EnumBitmaskOps.h
"
20
21
namespace
heavyai {
22
23
enum class
InSituFlags
{
24
kInSitu
= 1u << 0,
25
kNonInSitu
= 1u << 1,
26
kForcedNonInSitu
= (
kInSitu
|
kNonInSitu
)
27
};
28
29
}
// namespace heavyai
30
31
ENABLE_BITMASK_OPS
(
heavyai::InSituFlags
);
32
33
namespace
heavyai {
34
35
// Needs to be defined after the ENABLE_BITMASK_OPS call above
36
class
InSituFlagsOwnerInterface
{
37
public
:
38
InSituFlagsOwnerInterface
(
const
InSituFlags
insitu_flags)
39
: insitu_flags_{insitu_flags} {}
40
41
InSituFlags
getInSituFlags
()
const
{
return
insitu_flags_; }
42
43
bool
isForcedNonInSitu
()
const
{
44
return
(insitu_flags_ &
InSituFlags::kForcedNonInSitu
) ==
45
InSituFlags::kForcedNonInSitu
;
46
}
47
48
bool
isInSitu
()
const
{
return
insitu_flags_ ==
InSituFlags::kInSitu
; }
49
50
bool
isNonInSitu
()
const
{
51
return
any_bits_set
(insitu_flags_ &
InSituFlags::kNonInSitu
);
52
}
53
54
bool
couldRunInSitu
()
const
{
55
return
any_bits_set
(insitu_flags_ &
InSituFlags::kInSitu
);
56
}
57
58
protected
:
59
InSituFlags
insitu_flags_
;
60
};
61
62
}
// namespace heavyai
heavyai::InSituFlags
InSituFlags
Definition:
InSituFlags.h:23
heavyai::InSituFlagsOwnerInterface::couldRunInSitu
bool couldRunInSitu() const
Definition:
InSituFlags.h:54
heavyai::InSituFlags::kInSitu
heavyai::InSituFlagsOwnerInterface::isForcedNonInSitu
bool isForcedNonInSitu() const
Definition:
InSituFlags.h:43
heavyai::InSituFlags::kNonInSitu
EnumBitmaskOps.h
heavyai::InSituFlagsOwnerInterface
Definition:
InSituFlags.h:36
heavyai::InSituFlagsOwnerInterface::isNonInSitu
bool isNonInSitu() const
Definition:
InSituFlags.h:50
heavyai::InSituFlagsOwnerInterface::getInSituFlags
InSituFlags getInSituFlags() const
Definition:
InSituFlags.h:41
any_bits_set
std::enable_if_t< EnableBitmaskOps< T >::enable, bool > constexpr any_bits_set(T t)
Definition:
EnumBitmaskOps.h:76
heavyai::InSituFlags::kForcedNonInSitu
ENABLE_BITMASK_OPS
ENABLE_BITMASK_OPS(heavyai::InSituFlags)
heavyai::InSituFlagsOwnerInterface::insitu_flags_
InSituFlags insitu_flags_
Definition:
InSituFlags.h:59
heavyai::InSituFlagsOwnerInterface::isInSitu
bool isInSitu() const
Definition:
InSituFlags.h:48
heavyai::InSituFlagsOwnerInterface::InSituFlagsOwnerInterface
InSituFlagsOwnerInterface(const InSituFlags insitu_flags)
Definition:
InSituFlags.h:38
Shared
Rendering
InSituFlags.h
Generated on Tue Aug 27 2024 00:12:44 for OmniSciDB by
1.8.5