ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CxxUtils
CxxUtils
Ring.h
Go to the documentation of this file.
1
// This file's extension implies that it's C, but it's really -*- C++ -*-.
2
/*
3
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
4
*/
5
/*
6
*/
13
14
15
#ifndef CXXUTILS_RING_H
16
#define CXXUTILS_RING_H
17
18
19
#include <vector>
20
#include <cstddef>
21
22
23
namespace
CxxUtils
{
24
25
38
template
<
class
T>
39
class
Ring
40
{
41
public
:
46
void
reset
(
size_t
size
);
47
48
53
void
push
(
const
T&
x
);
54
55
62
std::vector<T>
getKeysDedup
()
const
;
63
64
65
private
:
66
std::vector<T>
m_data
;
67
size_t
m_pos
= 0;
68
};
69
70
71
}
// namespace CxxUtils
72
73
74
#include "
CxxUtils/Ring.icc
"
75
76
77
#endif
// not CXXUTILS_RING_H
Ring.icc
x
#define x
CxxUtils::Ring
A very simple ring buffer.
Definition
Ring.h:40
CxxUtils::Ring::reset
void reset(size_t size)
Clear the buffer and set its size.
CxxUtils::Ring< key_type >::m_data
std::vector< key_type > m_data
Definition
Ring.h:66
CxxUtils::Ring< key_type >::m_pos
size_t m_pos
Definition
Ring.h:67
CxxUtils::Ring::getKeysDedup
std::vector< T > getKeysDedup() const
Return a copy of keys in the buffer.
CxxUtils::Ring::push
void push(const T &x)
Add a new item to the buffer.
CxxUtils
Definition
aligned_vector.h:29
CxxUtils::size
bit_t size() const
Count the number of 1 bits in the set.
Generated on
for ATLAS Offline Software by
1.17.0