ROOT
v6-24
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/RDF/RSlotStack.hxx
>
13
#include <
TError.h
>
// R__ASSERT
14
15
#include <mutex>
// std::lock_guard
16
17
ROOT::Internal::RDF::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::RDF::RSlotStack::ReturnSlot
(
unsigned
int
slot)
24
{
25
std::lock_guard<ROOT::TSpinMutex> guard(fMutex);
26
R__ASSERT
(fStack.size() <
fSize
&&
"Trying to put back a slot to a full stack!"
);
27
fStack.push(slot);
28
}
29
30
unsigned
int
ROOT::Internal::RDF::RSlotStack::GetSlot
()
31
{
32
std::lock_guard<ROOT::TSpinMutex> guard(fMutex);
33
R__ASSERT
(!fStack.empty() &&
"Trying to pop a slot from an empty stack!"
);
34
const
auto
slot = fStack.top();
35
fStack.pop();
36
return
slot;
37
}
fSize
size_t fSize
Definition
DeclareConverters.h:342
RSlotStack.hxx
TError.h
R__ASSERT
#define R__ASSERT(e)
Definition
TError.h:120
TSeq.hxx
ROOT::Internal::RDF::RSlotStack::ReturnSlot
void ReturnSlot(unsigned int slotNumber)
Definition
RSlotStack.cxx:23
ROOT::Internal::RDF::RSlotStack::fStack
std::stack< unsigned int > fStack
Definition
RSlotStack.hxx:29
ROOT::Internal::RDF::RSlotStack::RSlotStack
RSlotStack()=delete
ROOT::Internal::RDF::RSlotStack::GetSlot
unsigned int GetSlot()
Definition
RSlotStack.cxx:30
ROOT::TSeqU
TSeq< unsigned int > TSeqU
Definition
TSeq.hxx:195
tree
dataframe
src
RSlotStack.cxx
ROOT v6-24 - Reference Guide Generated on Tue Aug 22 2023 03:06:54 (GVA Time) using Doxygen 1.9.8