Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
duneprototypes
duneprototypes
Protodune
singlephase
CRT
alg
plot
StyleSentry.cpp
Go to the documentation of this file.
1
//File: StyleSentry.cpp
2
//Brief: Allows for changes to TStyle that are local to some scope by making a copy
3
// of the old gStyle for changes and restoring back to the original on destruction.
4
// Inspired by how ART's TFileService handles gFile.
5
//Author: Andrew Olivier aolivier@ur.rochester.edu
6
7
//ROOT includes
8
#include "TStyle.h"
9
10
namespace
util
11
{
12
struct
StyleSentry
13
{
14
StyleSentry
():
fOldStyle
(gStyle)
15
{
16
if
(gStyle) gStyle =
new
TStyle(*gStyle);
17
else
gStyle =
new
TStyle();
18
}
19
20
~StyleSentry
() { gStyle =
fOldStyle
; }
21
22
private
:
23
TStyle*
fOldStyle
;
//The old gStyle that will be restored when this object is destroyed
24
};
25
}
util::StyleSentry::~StyleSentry
~StyleSentry()
Definition:
StyleSentry.cpp:20
util
Namespace for general, non-LArSoft-specific utilities.
Definition:
SignalShapingService.h:21
util::StyleSentry::StyleSentry
StyleSentry()
Definition:
StyleSentry.cpp:14
util::StyleSentry
Definition:
StyleSentry.cpp:12
util::StyleSentry::fOldStyle
TStyle * fOldStyle
Definition:
StyleSentry.cpp:23
Generated by
1.8.11