Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
berryLockListener.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _BERRY_LOCKLISTENER_H_
18 #define _BERRY_LOCKLISTENER_H_
19 
20 #include <org_blueberry_core_jobs_Export.h>
21 #include <Poco/Thread.h>
22 #include <berryObject.h>
23 
24 namespace berry
25 {
26 
37 class LockListener: public Object
38 {
39 
40  berryObjectMacro( LockListener);
41 
42  // LockManager::ConstPointer manager = ((JobManager)Job.getJobManager()).getLockManager();
43 
44 
45 public:
46 
59  inline virtual bool AboutToWait(Poco::Thread* lockOwner)
60  {
61  return false;
62  }
63 
69  inline virtual void AboutToRelease()
70  {
71  //do nothing
72  }
73 
74 protected:
75 
81  inline bool IsLockOwnerThread() const
82  {
83  return manager.isLockOwner();
84  }
85 
86 };
87 
88 }
89 #endif // _BERRY_LOCKLISTENER_H_
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
bool IsLockOwnerThread() const
virtual void AboutToRelease()
virtual bool AboutToWait(Poco::Thread *lockOwner)