Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryDebugBreakpointManager.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 
18 #ifndef BERRYDEBUGBREAKPOINTMANAGER_H_
19 #define BERRYDEBUGBREAKPOINTMANAGER_H_
20 
21 #include <Poco/HashMap.h>
22 #include <set>
23 
25 
26 namespace berry {
27 
28 class Object;
29 
31 {
32 public:
33 
34  static const std::string BREAKPOINTS_XML;
35 
36  void AddSmartpointerBreakpoint(int smartPointerId, const Object* obj = nullptr);
37  void AddObjectBreakpoint(unsigned long objectTraceId);
38 
39  void RemoveSmartpointerBreakpoint(int smartPointerId);
40  void RemoveObjectBreakpoint(unsigned long objectTraceId);
41 
42  const std::set<unsigned long>& GetObjectBreakpoints() const;
43  const Poco::HashMap<int, const Object*>& GetSmartPointerBreakpoints() const;
44 
45  bool BreakAtObject(unsigned long traceId) const;
46  bool BreakAtSmartpointer(int spId) const;
47 
48  void SaveState(const QString& path) const;
49  void RestoreState(const QString& path);
50 
51 private:
52 
53  friend class DebugUtil;
54 
57 
58  static const std::string BREAKPOINTS_TAG;
59  static const std::string OBJECT_TAG;
60  static const std::string SMARTPOINTER_TAG;
61 
62  static const std::string ID_ATTR;
63  static const std::string CLASSNAME_ATTR;
64  static const std::string OBJECTID_ATTR;
65  static const std::string ENABLED_ATTR;
66 
67  std::set<unsigned long> m_ObjectBreakpoints;
68  Poco::HashMap<int, const Object*> m_SmartPointerBreakpoints;
69 };
70 
71 }
72 
73 #endif /* BERRYDEBUGBREAKPOINTMANAGER_H_ */
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
#define org_blueberry_core_runtime_EXPORT
static const std::string BREAKPOINTS_XML