Open
Graph Drawing
Framework
v. 2023.09 (Elderberry)
Overview
Class Hierarchy
Class Index
Class List
Members
Namespaces
Source Files
Loading...
Searching...
No Matches
TimestampFlags.h
Go to the documentation of this file.
1
31
#pragma once
32
33
#include <
ogdf/basic/basic.h
>
34
35
#include <cstddef>
36
#include <limits>
37
#include <vector>
38
39
namespace
ogdf
{
40
namespace
internal {
41
namespace
gcm {
42
namespace
datastructure {
43
44
class
TimestampFlags
{
45
private
:
46
std::vector<unsigned int>
flags
;
47
unsigned
int
current_round
= 1;
48
49
public
:
50
TimestampFlags
() {
/*nothing to do*/
51
}
52
53
TimestampFlags
(
size_t
size
) :
flags
(
size
, 0) {
/*nothing to do*/
54
}
55
56
size_t
size
()
const
{
return
flags
.size(); }
57
58
void
clear
() {
59
++
current_round
;
60
if
(
current_round
== std::numeric_limits<unsigned int>::max()) {
61
current_round
= 1;
62
std::fill(
flags
.begin(),
flags
.end(), 0);
63
}
64
}
65
66
inline
bool
is_set
(
size_t
id
)
const
{
67
OGDF_ASSERT
(
id
<
flags
.size());
68
return
flags
[id] ==
current_round
;
69
}
70
71
inline
void
set
(
size_t
id
) {
72
OGDF_ASSERT
(
id
<
flags
.size());
73
flags
[id] =
current_round
;
74
}
75
};
76
77
}
78
}
79
}
80
}
basic.h
Basic declarations, included by all source files.
ogdf::internal::gcm::datastructure::TimestampFlags
Definition
TimestampFlags.h:44
ogdf::internal::gcm::datastructure::TimestampFlags::is_set
bool is_set(size_t id) const
Definition
TimestampFlags.h:66
ogdf::internal::gcm::datastructure::TimestampFlags::clear
void clear()
Definition
TimestampFlags.h:58
ogdf::internal::gcm::datastructure::TimestampFlags::TimestampFlags
TimestampFlags()
Definition
TimestampFlags.h:50
ogdf::internal::gcm::datastructure::TimestampFlags::set
void set(size_t id)
Definition
TimestampFlags.h:71
ogdf::internal::gcm::datastructure::TimestampFlags::current_round
unsigned int current_round
Definition
TimestampFlags.h:47
ogdf::internal::gcm::datastructure::TimestampFlags::flags
std::vector< unsigned int > flags
Definition
TimestampFlags.h:46
ogdf::internal::gcm::datastructure::TimestampFlags::size
size_t size() const
Definition
TimestampFlags.h:56
ogdf::internal::gcm::datastructure::TimestampFlags::TimestampFlags
TimestampFlags(size_t size)
Definition
TimestampFlags.h:53
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition
basic.h:41
ogdf
The namespace for all OGDF objects.
Definition
AugmentationModule.h:36
include
ogdf
geometric
cr_min
datastructure
TimestampFlags.h
© 1999–2023
The OGDF Team