ROOT
v6-32
Reference Guide
Loading...
Searching...
No Matches
RSlotStack.cxx
Go to the documentation of this file.
1
// Author: Enrico Guiraud, Danilo Piparo CERN 03/2017
2
3
/*************************************************************************
4
* Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5
* All rights reserved. *
6
* *
7
* For the licensing terms see $ROOTSYS/LICENSE. *
8
* For the list of contributors see $ROOTSYS/README/CREDITS. *
9
*************************************************************************/
10
11
#include <
ROOT/TSeq.hxx
>
12
#include <
ROOT/RSlotStack.hxx
>
13
14
#include <cassert>
15
#include <mutex>
// std::lock_guard
16
17
ROOT::Internal::RSlotStack::RSlotStack
(
unsigned
int
size
) :
fSize
(
size
)
18
{
19
for
(
auto
i
:
ROOT::TSeqU
(
size
))
20
fStack
.push(
i
);
21
}
22
23
void
ROOT::Internal::RSlotStack::ReturnSlot
(
unsigned
int
slot)
24
{
25
std::lock_guard<ROOT::TSpinMutex> guard(
fMutex
);
26
assert(
fStack
.size() <
fSize
&&
"Trying to put back a slot to a full stack!"
);
27
(void)
fSize
;
28
fStack
.push(slot);
29
}
30
31
unsigned
int
ROOT::Internal::RSlotStack::GetSlot
()
32
{
33
std::lock_guard<ROOT::TSpinMutex> guard(
fMutex
);
34
assert(!
fStack
.empty() &&
"Trying to pop a slot from an empty stack!"
);
35
const
auto
slot =
fStack
.top();
36
fStack
.pop();
37
return
slot;
38
}
RSlotStack.hxx
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
i
Int_t i
Definition
TGraphAsymmErrors.cxx:1306
TSeq.hxx
ROOT::Internal::RSlotStack::GetSlot
unsigned int GetSlot()
Definition
RSlotStack.cxx:31
ROOT::Internal::RSlotStack::fMutex
ROOT::TSpinMutex fMutex
Definition
RSlotStack.hxx:34
ROOT::Internal::RSlotStack::RSlotStack
RSlotStack()=delete
ROOT::Internal::RSlotStack::fSize
const unsigned int fSize
Definition
RSlotStack.hxx:32
ROOT::Internal::RSlotStack::fStack
std::stack< unsigned int > fStack
Definition
RSlotStack.hxx:33
ROOT::Internal::RSlotStack::ReturnSlot
void ReturnSlot(unsigned int slotNumber)
Definition
RSlotStack.cxx:23
ROOT::TSeqU
TSeq< unsigned int > TSeqU
Definition
TSeq.hxx:204
core
imt
src
RSlotStack.cxx
ROOT v6-32 - Reference Guide Generated on Tue May 19 2026 02:46:45 (GVA Time) using Doxygen 1.13.2