]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/STEERBase/AliVEventHandler.cxx
d98fce669f9b0e5cee005602f33f10f47288f438
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliVEventHandler.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 //-------------------------------------------------------------------------
19 //     Event IO handler base class
20 //     Author: Andreas Morsch, CERN
21 //-------------------------------------------------------------------------
22
23 #include "AliVEventHandler.h"
24
25 ClassImp(AliVEventHandler)
26
27 //______________________________________________________________________________
28 AliVEventHandler::AliVEventHandler() :
29   TNamed()
30 {
31   // default constructor
32 }
33
34 //______________________________________________________________________________
35 AliVEventHandler::~AliVEventHandler() 
36 {
37 // destructor
38 }
39
40 //______________________________________________________________________________
41 AliVEventHandler::AliVEventHandler(const char* name, const char* title):
42     TNamed(name, title)
43 {
44 }
45 //______________________________________________________________________________
46 void AliVEventHandler::Lock()
47 {
48 // Security lock. This is to detect NORMAL user errors and not really to
49 // protect against intentional hacks.
50    if (IsLocked()) return;
51    TObject::SetBit(kHandlerLocked, kTRUE);
52 }
53
54 //______________________________________________________________________________
55 void AliVEventHandler::UnLock()
56 {
57 // Verbose unlocking. Hackers will be punished ;-) ... 
58    if (!IsLocked()) return;
59    TObject::SetBit(kHandlerLocked, kFALSE);
60 }
61
62 //______________________________________________________________________________
63 void AliVEventHandler::Changed()
64 {
65 // All critical setters pass through the Changed method that throws an exception 
66 // in case the lock was set.
67    if (IsLocked()) Fatal("Changed","Critical setter of a handler called in locked mode");
68 }