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
21
22////////////////////////////////////////////////////////////////////////////////
23/// Constructor.
24
25TEveEventManager::TEveEventManager(const char* n, const char* t) :
27 fNewEventCommands()
28{
29}
30
31////////////////////////////////////////////////////////////////////////////////
32/// Virtual function to be called after a new event is loaded.
33/// It iterates over the list of registered commands
34/// (fNewEventCommands) and executes them in given order.
35
37{
38 for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
39 {
40 gInterpreter->ProcessLine(*i);
41 }
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Register a command to be executed on each new event.
46
51
52////////////////////////////////////////////////////////////////////////////////
53/// Remove the first command equal to cmd.
54
56{
57 for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
58 {
59 if (cmd == *i) {
60 fNewEventCommands.erase(i);
61 break;
62 }
63 }
64}
65
66////////////////////////////////////////////////////////////////////////////////
67/// Clear the list of commands to be executed on each new event.
68
#define gInterpreter
A list of TEveElements.
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:138
const Int_t n
Definition legend1.C:16