OpendTect  6.3
namedobj.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: Sep 1994, Aug 2006, Mar 2015
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "basicmod.h"
14 #include "notify.h"
15 #include "bufstring.h"
16 
17 
21 {
22 public:
23 
24  NamedObject( const char* nm=0 )
25  : name_(nm) {}
26  NamedObject( const NamedObject& oth )
27  : name_(oth.getName()) {}
28  virtual ~NamedObject() {}
29  NamedObject& operator =(const NamedObject&);
30  bool operator ==( const NamedObject& oth ) const
31  { return name_ == oth.getName(); }
32 
33  virtual const OD::String& name() const { return name_; }
34  virtual BufferString getName() const { return name_; }
35  virtual void setName( const char* nm ) { name_ = nm; }
36 
37  bool getNameFromPar(const IOPar&);
38  void putNameInPar(IOPar&) const;
39 
40 protected:
41 
43 
44 };
45 
46 
51  , public NamedObject
52 {
53 public:
54 
55  NamedCallBacker(const char* nm=0);
57 
58  inline bool operator ==( const NamedCallBacker& oth ) const
59  { return name_ == oth.getName(); }
60  inline bool operator ==( const NamedObject& oth ) const
61  { return name_ == oth.getName(); }
62 
64  { return const_cast<NamedCallBacker*>(this)->delnotif_;}
65 
66 protected:
67 
70  void sendDelNotif() const;
71 
72 };
73 
74 
75 mGlobal(Basic) inline bool operator >( const NamedObject& obj1,
76  const NamedObject& obj2 )
77 {
78  return obj1.getName() > obj2.getName();
79 }
#define mExpClass(module)
Definition: commondefs.h:157
virtual Notifier< NamedCallBacker > & objectToBeDeleted() const
Definition: namedobj.h:63
virtual void setName(const char *nm)
Definition: namedobj.h:35
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:182
virtual ~NamedObject()
Definition: namedobj.h:28
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:51
#define mGlobal(module)
Definition: commondefs.h:160
NamedObject(const NamedObject &oth)
Definition: namedobj.h:26
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:29
Threads::Atomic< bool > delalreadytriggered_
Definition: namedobj.h:69
virtual BufferString getName() const
Definition: namedobj.h:34
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
object with a name.
Definition: namedobj.h:20
Notifier< NamedCallBacker > delnotif_
Definition: namedobj.h:68
NamedObject(const char *nm=0)
Definition: namedobj.h:24
virtual const OD::String & name() const
Definition: namedobj.h:33
BufferString name_
Definition: namedobj.h:42
CallBacker object with a name. Use if you want your object to be able to send and receive CallBack&#39;s...
Definition: namedobj.h:50

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