OpendTect  6.3
ctxtioobj.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: A.H. Bril
8  Date: 7-1-1996
9 ________________________________________________________________________
10 
11 -*/
12 
13 #include "ioobjctxt.h"
14 #include "ioobj.h"
15 
16 
24 mExpClass(General) CtxtIOObj : public NamedObject
25 {
26 public:
28  CtxtIOObj( const IOObjContext& ct, IOObj* o=0 )
29  : NamedObject(ct), ctxt_(ct), ioobj_(o)
30  , iopar_(0), ctxt(ctxt_), ioobj(ioobj_)
31  , iopar(iopar_)
32  { if ( o ) setName(o->name()); }
33  CtxtIOObj( const CtxtIOObj& ct )
34  : NamedObject(ct), ctxt_(ct.ctxt_)
35  , ioobj_(ct.ioobj_?ct.ioobj_->clone():0)
36  , iopar_(ct.iopar_?new IOPar(*ct.iopar_):0)
37  , ctxt(ctxt_), ioobj(ioobj_), iopar(iopar_)
38  {}
40  void destroyAll();
41 
42  virtual const OD::String& name() const { return ctxt_.name(); }
43  virtual void setName(const char* nm) { ctxt_.setName(nm); }
44  virtual BufferString getName() const { return ctxt_.getName(); }
45 
46  void setObj(IOObj*);
47  void setObj(const DBKey&);
48  void setPar(IOPar*);
49  int fillObj(bool mktmpifnew=false,int translidxfornew=-1);
52  void fillIfOnlyOne();
55  void fillDefault(bool alsoifonlyone=true);
57  void fillDefaultWithKey(const char*,bool alsoifonlyone=true);
59 
63 
64  //Legacy
68 };
#define mExpClass(module)
Definition: commondefs.h:157
Definition: ioobj.h:57
IOObj * ioobj_
Definition: ctxtioobj.h:61
Holds an IOObjCtxt plus a pointer to an IOObj and/or an IOPar.
Definition: ctxtioobj.h:24
IOPar * iopar_
Definition: ctxtioobj.h:62
mDeprecated IOObjContext & ctxt
Definition: ctxtioobj.h:65
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
#define mStartAllowDeprecatedSection
Definition: plfdefs.h:215
virtual void setName(const char *nm)
Definition: ctxtioobj.h:43
#define mStopAllowDeprecatedSection
Definition: plfdefs.h:218
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:29
mStartAllowDeprecatedSection CtxtIOObj(const IOObjContext &ct, IOObj *o=0)
Definition: ctxtioobj.h:28
mDeprecated IOObj *& ioobj
Definition: ctxtioobj.h:66
CtxtIOObj(const CtxtIOObj &ct)
Definition: ctxtioobj.h:33
#define mDeprecated
Definition: plfdefs.h:213
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
virtual const OD::String & name() const
Definition: ctxtioobj.h:42
virtual BufferString getName() const
Definition: ctxtioobj.h:44
Full key to any object in the OpendTect data store.
Definition: dbkey.h:36
IOObjContext ctxt_
Definition: ctxtioobj.h:60
mDeprecated IOPar *& iopar
Definition: ctxtioobj.h:67
Holds the context for selecting and/or creating IOObjs.
Definition: ioobjctxt.h:59

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