OpendTect-6_4  6.4
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
IOMan Class Reference

manages the 'Meta-'data store for the IOObj's. This info is read from the .omf files. More...

Inheritance diagram for IOMan:
[legend]

Classes

class  CustomDirData
 

Public Member Functions

bool isBad () const
 
bool isReady () const
 
const OD::Stringmessage () const
 
IOObjget (const MultiID &) const
 Next functions return a new (unmanaged) IOObj. More...
 
IOObjgetLocal (const char *objname, const char *tgname) const
 
IOObjgetOfGroup (const char *tgname, bool first=true, bool onlyifsingle=false) const
 
IOObjgetIfOnlyOne (const char *trgroupname)
 
IOObjgetFirst (const IOObjContext &, int *nrpresent=0) const
 if interested in nrpresent pass valid address More...
 
IOObjgetFromPar (const IOPar &, const char *basekey, const IOObjContext &, bool mknew, BufferString &errmsg) const
 
IOObjget (const char *objname, const char *tgname) const
 
bool isPresent (const char *, const char *tgname=0) const
 
const MultiIDkey () const
 of current IODir More...
 
const char * curDirName () const
 OS dir name. More...
 
const char * rootDir () const
 
bool isKey (const char *keystr) const
 
const char * nameOf (const char *keystr) const
 if keystr is not an IOObj key, will return keystr More...
 
MultiID createNewKey (const MultiID &dirkey)
 
bool to (const MultiID &, bool force_reread=false)
 
bool toRoot (bool force_reread=false)
 
void getEntry (CtxtIOObj &, bool newistmp=false, int translidxingroup=-1)
 will create a new entry if necessary More...
 
bool commitChanges (const IOObj &)
 
bool permRemove (const MultiID &)
 Removes only entry in IODir. More...
 
const char * surveyName () const
 
bool setRootDir (const char *)
 
void setChangeSurveyBlocked (bool yn)
 
bool changeSurveyBlocked () const
 
void applClosing ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Static Public Member Functions

static const MultiIDaddCustomDataDir (const CustomDirData &)
 
static bool isValidDataRoot (const char *dirnm)
 
static bool isValidSurveyDir (const char *dirnm)
 
static bool validSurveySetup (BufferString &errmsg)
 
static IOSubDirgetIOSubDir (const CustomDirData &)
 
static bool newSurvey (SurveyInfo *newsi=0)
 
static bool setSurvey (const char *)
 
static void surveyParsChanged ()
 

Public Attributes

Notifier< IOMannewIODir
 
Notifier< IOManentryRemoved
 CallBacker: CBCapsule<MultiID> More...
 
Notifier< IOManentryAdded
 
Notifier< IOMansurveyToBeChanged
 Before the change. More...
 
Notifier< IOMansurveyChanged
 To restore OD to normal state. More...
 
Notifier< IOManafterSurveyChange
 When operating in normal state. More...
 
Notifier< IOManapplicationClosing
 'Final' call ... More...
 

Private Types

enum  State { Bad, NeedInit, Good }
 

Private Member Functions

void init ()
 
void reInit (bool dotrigger)
 
 IOMan (const char *rd=0)
 
 ~IOMan ()
 
bool setDir (const char *)
 
int levelOf (const char *dirnm) const
 
int curLevel () const
 
bool to (const IOSubDir *, bool)
 
IOObjcrWriteIOObj (const CtxtIOObj &, const MultiID &, int) const
 

Static Private Member Functions

static void setupCustomDataDirs (int)
 

Private Attributes

BufferString rootdir_
 
State state_
 
IODirdirptr_
 
int curlvl_
 
BufferString msg_
 
bool survchgblocked_
 
Threads::Lock lock_
 

Static Private Attributes

static IOMantheinst_
 

Friends

class SurveyDataTreePreparer
 
IOManIOM ()
 

Additional Inherited Members

- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 

Detailed Description

manages the 'Meta-'data store for the IOObj's. This info is read from the .omf files.

There will be one IOMan available through the global function IOM(). Creating more instances is probably not a good idea.

Member Enumeration Documentation

enum IOMan::State
private
Enumerator
Bad 
NeedInit 
Good 

Constructor & Destructor Documentation

IOMan::IOMan ( const char *  rd = 0)
private
IOMan::~IOMan ( )
private

Member Function Documentation

static const MultiID& IOMan::addCustomDataDir ( const CustomDirData )
static

Need to do this only once per OD run At survey change, dir will automatically be added

void IOMan::applClosing ( )
inline
bool IOMan::changeSurveyBlocked ( ) const
inline
bool IOMan::commitChanges ( const IOObj )
MultiID IOMan::createNewKey ( const MultiID dirkey)
IOObj* IOMan::crWriteIOObj ( const CtxtIOObj ,
const MultiID ,
int   
) const
private
const char* IOMan::curDirName ( ) const

OS dir name.

int IOMan::curLevel ( ) const
inlineprivate
IOObj* IOMan::get ( const MultiID ) const

Next functions return a new (unmanaged) IOObj.

IOObj* IOMan::get ( const char *  objname,
const char *  tgname 
) const
void IOMan::getEntry ( CtxtIOObj ,
bool  newistmp = false,
int  translidxingroup = -1 
)

will create a new entry if necessary

IOObj* IOMan::getFirst ( const IOObjContext ,
int *  nrpresent = 0 
) const

if interested in nrpresent pass valid address

IOObj* IOMan::getFromPar ( const IOPar ,
const char *  basekey,
const IOObjContext ,
bool  mknew,
BufferString errmsg 
) const
IOObj* IOMan::getIfOnlyOne ( const char *  trgroupname)
inline
static IOSubDir* IOMan::getIOSubDir ( const CustomDirData )
static
IOObj* IOMan::getLocal ( const char *  objname,
const char *  tgname 
) const
IOObj* IOMan::getOfGroup ( const char *  tgname,
bool  first = true,
bool  onlyifsingle = false 
) const
void IOMan::init ( )
private
bool IOMan::isBad ( ) const
inline
bool IOMan::isKey ( const char *  keystr) const
bool IOMan::isPresent ( const char *  ,
const char *  tgname = 0 
) const

Use before creating a named object

Parameters
tgnameexample: EMHorizon3DTranslatorGroup::sGroupName().str()
bool IOMan::isReady ( ) const
static bool IOMan::isValidDataRoot ( const char *  dirnm)
static
static bool IOMan::isValidSurveyDir ( const char *  dirnm)
static
const MultiID& IOMan::key ( ) const

of current IODir

int IOMan::levelOf ( const char *  dirnm) const
private
const OD::String& IOMan::message ( ) const
inline
const char* IOMan::nameOf ( const char *  keystr) const

if keystr is not an IOObj key, will return keystr

static bool IOMan::newSurvey ( SurveyInfo newsi = 0)
static

set new SurveyInfo; force re-read the data tree.

bool IOMan::permRemove ( const MultiID )

Removes only entry in IODir.

void IOMan::reInit ( bool  dotrigger)
private
const char* IOMan::rootDir ( ) const
inline
void IOMan::setChangeSurveyBlocked ( bool  yn)
inline
bool IOMan::setDir ( const char *  )
private
bool IOMan::setRootDir ( const char *  )
static bool IOMan::setSurvey ( const char *  )
static

will remove existing IO manager and set the survey to 'name', thus bypassing the .od/survey file

static void IOMan::setupCustomDataDirs ( int  )
staticprivate
const char* IOMan::surveyName ( ) const
static void IOMan::surveyParsChanged ( )
static
bool IOMan::to ( const MultiID ,
bool  force_reread = false 
)
bool IOMan::to ( const IOSubDir ,
bool   
)
private
bool IOMan::toRoot ( bool  force_reread = false)
inline
static bool IOMan::validSurveySetup ( BufferString errmsg)
static

Friends And Related Function Documentation

IOMan& IOM ( )
friend
friend class SurveyDataTreePreparer
friend

Member Data Documentation

Notifier<IOMan> IOMan::afterSurveyChange

When operating in normal state.

Notifier<IOMan> IOMan::applicationClosing

'Final' call ...

int IOMan::curlvl_
private
IODir* IOMan::dirptr_
private
Notifier<IOMan> IOMan::entryAdded
Notifier<IOMan> IOMan::entryRemoved

CallBacker: CBCapsule<MultiID>

Threads::Lock IOMan::lock_
mutableprivate
BufferString IOMan::msg_
private
Notifier<IOMan> IOMan::newIODir
BufferString IOMan::rootdir_
private
State IOMan::state_
private
bool IOMan::survchgblocked_
private
Notifier<IOMan> IOMan::surveyChanged

To restore OD to normal state.

Notifier<IOMan> IOMan::surveyToBeChanged

Before the change.

IOMan* IOMan::theinst_
staticprivate

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