LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AccessChecked.cc
Go to the documentation of this file.
1 #include "IMPL/AccessChecked.h"
2 #include <iostream>
3 
4 
5 namespace IMPL {
6 
8 
9  AccessChecked::AccessChecked() : _readOnly(false) {
10  // provide a simple unique id for LCObjects
11  _id = _lCObjectId++ ;
12  }
13 
14  void AccessChecked::setReadOnly( bool readOnly ) {
15  _readOnly = readOnly ;
16  }
17 
19  if( _readOnly ) {
20  throw EVENT::ReadOnlyException("") ;
21  }
22  }
23 
24  void AccessChecked::checkAccess(const char* what) {
25  if( _readOnly ) {
26  throw EVENT::ReadOnlyException(what) ;
27  }
28  }
29 
30 }
virtual void setReadOnly(bool readOnly)
static std::atomic_int _lCObjectId
Definition: AccessChecked.h:37
EventException used for signaling a &#39;read only exception&#39;.
Definition: Exceptions.h:74