Warning, /include/Geant4/toolx/X11/dispatcher is written in an unsupported language. File is not indexed.
0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003
0004 #ifndef toolx_X11_dispatcher
0005 #define toolx_X11_dispatcher
0006
0007 #include <X11/Xlib.h>
0008
0009 #ifdef TOOLS_MEM
0010 #include <tools/mem>
0011 #endif
0012
0013 namespace toolx {
0014 namespace X11 {
0015
0016 class dispatcher {
0017 protected:
0018 #ifdef TOOLS_MEM
0019 static const std::string& s_class() {
0020 static const std::string s_v("toolx::X11::dispatcher");
0021 return s_v;
0022 }
0023 #endif
0024 public:
0025 virtual bool dispatch(XEvent&) = 0;
0026 virtual Window window() const = 0;
0027 virtual dispatcher* copy() const = 0;
0028 public:
0029 dispatcher():m_is_valid(true){
0030 #ifdef TOOLS_MEM
0031 tools::mem::increment(s_class().c_str());
0032 #endif
0033 }
0034 virtual ~dispatcher(){
0035 #ifdef TOOLS_MEM
0036 tools::mem::decrement(s_class().c_str());
0037 #endif
0038 }
0039 public:
0040 dispatcher(const dispatcher& a_from):m_is_valid(a_from.m_is_valid){
0041 #ifdef TOOLS_MEM
0042 tools::mem::increment(s_class().c_str());
0043 #endif
0044 }
0045 dispatcher& operator=(const dispatcher& a_from) { m_is_valid = a_from.m_is_valid;return *this;}
0046 public:
0047 bool is_valid() const {return m_is_valid;}
0048 void invalidate() {m_is_valid = false;}
0049 protected:
0050 bool m_is_valid;
0051 };
0052
0053 }}
0054
0055
0056 #endif