OpendTect  6.6
monitorchangerecorder.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert
8  Date: June 2016
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "namedmonitoredobject.h"
14 #include "uistring.h"
15 #include "objectset.h"
16 
17 
21 {
22 public:
23 
26  bool isEmpty() const;
27  void setEmpty();
28 
29  enum Action { Undo, Redo };
30 
33  public:
35  virtual ~Record() {}
36  virtual Record* clone() const = 0;
37  virtual bool isValid() const = 0;
38  virtual uiString name() const = 0;
39  virtual uiString actionText(Action) const;
40  virtual bool apply(MonitoredObject&,Action) const = 0;
41  };
42 
43 
44  bool canApply(Action) const;
46  bool apply(Action);
47 
48 protected:
49 
51 
52  ChangeRecorder(MonitoredObject&,const char* nm);
53  ChangeRecorder(const MonitoredObject&,const char*);
54 
58  bool applying_;
59 
60  // fns with no locking:
61  void clear();
65  void addRec(Record*);
66 
67  virtual void handleObjChange(const ChangeData&) = 0;
68 
69 private:
70 
71  void init();
72 
73 };
ChangeRecorder::idx_type
ObjectSet< Record >::idx_type idx_type
Definition: monitorchangerecorder.h:50
ChangeRecorder::recs_
ObjectSet< Record > recs_
Definition: monitorchangerecorder.h:56
ChangeRecorder::~ChangeRecorder
~ChangeRecorder()
uistring.h
ObjectSet
Set of pointers to objects.
Definition: commontypes.h:31
NamedMonitoredObject
MonitoredObject with a name. All but name() are MT-safe.
Definition: namedmonitoredobject.h:22
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
ChangeRecorder::apply
bool apply(Action)
ChangeRecorder::Record::actionText
virtual uiString actionText(Action) const
ChangeRecorder
base class for recorder of changes in a MonitoredObject
Definition: monitorchangerecorder.h:21
ChangeRecorder::ChangeRecorder
ChangeRecorder(const MonitoredObject &, const char *)
ChangeRecorder::Record::~Record
virtual ~Record()
Definition: monitorchangerecorder.h:35
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
mODTextTranslationClass
#define mODTextTranslationClass(clss)
Definition: uistring.h:40
ChangeRecorder::addRec
void addRec(Record *)
ChangeRecorder::Record::name
virtual uiString name() const =0
ChangeRecorder::clear
void clear()
ChangeRecorder::objDel
void objDel(CallBacker *)
ChangeRecorder::handleObjChange
virtual void handleObjChange(const ChangeData &)=0
ChangeRecorder::Undo
@ Undo
Definition: monitorchangerecorder.h:29
ChangeRecorder::gtIdx
idx_type gtIdx(Action) const
ChangeRecorder::idx4redo_
idx_type idx4redo_
Definition: monitorchangerecorder.h:57
ChangeRecorder::Record::clone
virtual Record * clone() const =0
ChangeRecorder::applying_
bool applying_
Definition: monitorchangerecorder.h:58
ChangeRecorder::init
void init()
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
MonitoredObject::ChangeData
Definition: monitoredobject.h:115
ChangeRecorder::obj_
MonitoredObject * obj_
Definition: monitorchangerecorder.h:55
ChangeRecorder::setEmpty
void setEmpty()
ChangeRecorder::Record::isValid
virtual bool isValid() const =0
mDeclAbstractMonitorableAssignment
#define mDeclAbstractMonitorableAssignment(clss)
MonitoredObject subclasses: assignment and comparison.
Definition: monitor.h:114
ChangeRecorder::objChg
void objChg(CallBacker *)
ChangeRecorder::canApply
bool canApply(Action) const
ChangeRecorder::Action
Action
Definition: monitorchangerecorder.h:29
namedmonitoredobject.h
ChangeRecorder::Record::Action
ChangeRecorder::Action Action
Definition: monitorchangerecorder.h:34
ChangeRecorder::Record
Definition: monitorchangerecorder.h:32
ChangeRecorder::Record::apply
virtual bool apply(MonitoredObject &, Action) const =0
objectset.h
ChangeRecorder::usrText
uiString usrText(Action) const
ChangeRecorder::ChangeRecorder
ChangeRecorder(MonitoredObject &, const char *nm)
MonitoredObject
Object that can be MT-safely monitored from cradle to grave.
Definition: monitoredobject.h:77
ChangeRecorder::isEmpty
bool isEmpty() const

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021