Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveEventManager.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/*************************************************************************
5 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#include "TEveEventManager.h"
13
14#include "TInterpreter.h"
15
16/** \class TEveEventManager
17\ingroup TEve
18Base class for event management and navigation.
19*/
20
22
23////////////////////////////////////////////////////////////////////////////////
24/// Constructor.
25
26TEveEventManager::TEveEventManager(const char* n, const char* t) :
28 fNewEventCommands()
29{
30}
31
32////////////////////////////////////////////////////////////////////////////////
33/// Virtual function to be called after a new event is loaded.
34/// It iterates over the list of registered commands
35/// (fNewEventCommands) and executes them in given order.
36
38{
39 for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
40 {
41 gInterpreter->ProcessLine(*i);
42 }
43}
44
45////////////////////////////////////////////////////////////////////////////////
46/// Register a command to be executed on each new event.
47
49{
50 fNewEventCommands.push_back(cmd);
51}
52
53////////////////////////////////////////////////////////////////////////////////
54/// Remove the first command equal to cmd.
55
57{
58 for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
59 {
60 if (cmd == *i) {
61 fNewEventCommands.erase(i);
62 break;
63 }
64 }
65}
66
67////////////////////////////////////////////////////////////////////////////////
68/// Clear the list of commands to be executed on each new event.
69
71{
72 fNewEventCommands.clear();
73}
#define ClassImp(name)
Definition Rtypes.h:377
#define gInterpreter
A list of TEveElements.
Base class for event management and navigation.
virtual void AddNewEventCommand(const TString &cmd)
Register a command to be executed on each new event.
virtual void ClearNewEventCommands()
Clear the list of commands to be executed on each new event.
TEveEventManager(const char *n="TEveEventManager", const char *t="")
Constructor.
virtual void AfterNewEventLoaded()
Virtual function to be called after a new event is loaded.
virtual void RemoveNewEventCommand(const TString &cmd)
Remove the first command equal to cmd.
std::vector< TString > fNewEventCommands
Basic string class.
Definition TString.h:139
const Int_t n
Definition legend1.C:16