OpendTect  7.0
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 Referencefinal
Inheritance diagram for IOMan:
[legend]

Classes

class  CustomDirData
 

Public Member Functions

uiRetVal cancelTempSurvey_ ()
 
bool changeSurveyBlocked () const
 
bool commitChanges (const IOObj &)
 
MultiID createNewKey (const MultiID &dirkey)
 
const char * curDirName () const
 OS dir name. More...
 
bool ensureUniqueName (IOObj &)
 
mDeprecatedObs BufferString fullSurveyPath () const
 
IOObjget (const char *objname, const char *tgname) const
 
IOObjget (const DBKey &) const
 Next functions return a new (unmanaged) IOObj. More...
 
IOObjget (const IOObjContext &, const char *objnm) const
 
IOObjget (const MultiID &) const
 
IODirgetDir (const char *trlgrpnm) const
 
IODirgetDir (const MultiID &) const
 
IODirgetDir (IOObjContext::StdSelType) const
 
void getEntry (CtxtIOObj &, bool newistmp=false, int translidxingroup=-1)
 will create a new entry if necessary More...
 
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
 
IOObjgetIfOnlyOne (const char *trgroupname)
 
IOObjgetLocal (const char *objname, const char *tgname) const
 
void getNewEntry (CtxtIOObj &, bool newistmp=false, int translidxingroup=-1)
 will create a new entry if necessary More...
 
IOObjgetOfGroup (const char *tgname, bool first=true, bool onlyifsingle=false) const
 
bool implExists (const MultiID &) const
 
bool implIsLink (const MultiID &) const
 
bool implReloc (const MultiID &, const char *newdir)
 
bool implRemove (const IOObj &, bool deep=true) const
 
bool implRemove (const MultiID &, bool rmentry=false, uiRetVal *uirv=nullptr)
 
bool implRename (const MultiID &, const char *newnm)
 
CNotifier< IOMan, const MultiID & > & implUpdated ()
 
bool isBad () const
 
bool isKey (const char *keystr) const
 
bool isPresent (const char *, const char *tgname=0) const
 
bool isPresent (const MultiID &) const
 
bool isReadOnly (const MultiID &) const
 
bool isReady () const
 
bool isUsable (const DBKey &) const
 
bool isUsable (const MultiID &) const
 
bool isUsingTempSurvey () const
 
const MultiIDkey () const
 of current IODir More...
 
const OD::Stringmessage () const
 
const char * nameOf (const char *keystr) const
 if keystr is not an IOObj key, will return keystr More...
 
const char * nameOf (const MultiID &) const
 
const char * objectName (const DBKey &) const
 
bool permRemove (const MultiID &)
 Removes only entry in IODir. More...
 
Notifier< IOMan > & prepareSurveyChange ()
 Prepare, don't tear down. More...
 
bool recordDataSource (const SurveyDiskLocation &, uiRetVal &) const
 
void removeUnusable (DBKeySet &)
 
const char * rootDir () const
 Full path to the root of the current project. More...
 
void setChangeSurveyBlocked (bool yn)
 
uiRetVal setDataSource (const char *dataroot, const char *survdir, bool refresh=false)
 
uiRetVal setDataSource (const char *fullpath, bool refresh=false)
 
uiRetVal setDataSource (const CommandLineParser &, bool refresh=false)
 
uiRetVal setDataSource (const IOPar &, bool refresh=false)
 
bool setRootDir (const char *)
 
uiRetVal setTempSurvey_ (const SurveyDiskLocation &)
 
const char * surveyName () const
 
bool to (const MultiID &, bool force_reread=false)
 
bool to (IOObjContext::StdSelType, bool force_reread=false)
 
bool toRoot (bool force_reread=false)
 
const uiStringuiMessage () const
 
- Public Member Functions inherited from NamedCallBacker
 NamedCallBacker (const char *nm=0)
 
 NamedCallBacker (const NamedCallBacker &)
 
virtual Notifier< NamedCallBacker > & objectToBeDeleted () const
 
bool operator== (const NamedCallBacker &oth) const
 
bool operator== (const NamedObject &oth) const
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 
virtual CallBackertrueCaller ()
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=nullptr)
 
 NamedObject (const NamedObject &oth)
 
virtual ~NamedObject ()
 
virtual BufferString getName () const
 
bool getNameFromPar (const IOPar &)
 
const name_typename () const override
 
NamedObjectoperator= (const NamedObject &)
 
bool operator== (const NamedObject &oth) const
 
virtual void setName (const char *nm)
 
- Public Member Functions inherited from ObjectWithName
virtual ~ObjectWithName ()
 
bool hasName (const char *nm) const
 
bool hasName (const name_type &nm) const
 
void putNameInPar (IOPar &) const
 

Static Public Member Functions

static const MultiIDaddCustomDataDir (const CustomDirData &)
 
static void cancelTempSurvey ()
 
static IOSubDirgetIOSubDir (const CustomDirData &)
 
static BufferString getNewTempDataRootDir ()
 
static void getObjectNames (const DBKeySet &, BufferStringSet &)
 
static Notifier< IOMan > & iomReady ()
 
static bool isOK ()
 
static bool isPreparedForSurveyChange ()
 
static bool isValidDataRoot (const char *dirnm)
 Full path to a writable directory. More...
 
static uiRetVal isValidMsg ()
 
static bool isValidSurveyDir (const char *dirnm)
 Full path to an OpendTect project directory. More...
 
static bool newSurvey (SurveyInfo *newsi=0)
 
static bool prepareDataRoot (const char *dirnm)
 
static bool recordDataSource_ (const SurveyDiskLocation &, uiRetVal &)
 
static uiRetVal setDataSource_ (const char *dataroot, const char *survdir, bool refresh=false)
 
static uiRetVal setDataSource_ (const char *fullpath, bool refresh=false)
 
static uiRetVal setDataSource_ (const CommandLineParser &, bool refresh=false)
 
static bool setSurvey (const char *)
 
static void setTempSurvey (const SurveyDiskLocation &)
 
static void surveyParsChanged ()
 
static bool validSurveySetup (BufferString &errmsg)
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Public Attributes

Notifier< IOManafterSurveyChange
 When operating in normal state. More...
 
Notifier< IOManapplicationClosing
 'Final' call ... More...
 
CNotifier< IOMan, const MultiID & > entryAdded
 
CNotifier< IOMan, const MultiID & > entryChanged
 
CNotifier< IOMan, const MultiID & > entryRemoved
 
Notifier< IOMannewIODir
 
Notifier< IOMansurveyChanged
 To restore OD to normal state. More...
 
Notifier< IOMansurveyToBeChanged
 Before the change, tear down. More...
 

Private Types

enum  State { Bad , NeedInit , Good }
 

Private Member Functions

 IOMan (const char *rd=0)
 
 IOMan (const FilePath &rootdir)
 
 ~IOMan ()
 
void applClosing ()
 
bool close (bool dotrigger)
 
IOObjcrWriteIOObj (const CtxtIOObj &, const MultiID &, int) const
 
int curLevel () const
 
bool doReloc (const MultiID &, Translator *, IOStream &, IOStream &)
 
void getObjEntry (CtxtIOObj &, bool isnew, bool newistmp=false, int translidxingroup=-1)
 
mDeprecatedObs void init ()
 
void init (SurveyInfo *newsi)
 
int levelOf (const char *dirnm) const
 
mDeprecatedObs void reInit (bool dotrigger)
 
void reInit (SurveyInfo *newsi)
 
bool setDir (const char *)
 
uiRetVal setRootDir (const FilePath &, bool ischecked=false)
 fullPath to the survey directory More...
 
bool to (const IOSubDir *, bool)
 
bool writeSettingsSurveyFile (const char *dirnm, uiRetVal &) const
 

Static Private Member Functions

static void setupCustomDataDirs (int)
 
static bool writeSettingsSurveyFile_ (const char *dirnm, uiRetVal &)
 

Private Attributes

int curlvl_
 
IODirdirptr_ = nullptr
 
Threads::Lock lock_
 
uiString msg_
 
BufferString rootdir_
 
State state_ = NeedInit
 
bool survchgblocked_ = false
 

Static Private Attributes

static IOMantheinst_
 

Friends

class BatchProgram
 
IOManIOM ()
 
class IOMManager
 
class ServiceMgrBase
 
class SurveyDataTreePreparer
 
class uiMain
 

Additional Inherited Members

- Public Types inherited from ObjectWithName
typedef OD::String name_type
 
- Protected Member Functions inherited from NamedCallBacker
void sendDelNotif () const
 
- Protected Attributes inherited from NamedCallBacker
Threads::Atomic< bool > delalreadytriggered_
 
Notifier< NamedCallBackerdelnotif_
 
- Protected Attributes inherited from NamedObject
BufferString name_
 

Detailed Description

<>

Member Enumeration Documentation

◆ State

enum IOMan::State
private
Enumerator
Bad 
NeedInit 
Good 

Constructor & Destructor Documentation

◆ IOMan() [1/2]

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

◆ IOMan() [2/2]

IOMan::IOMan ( const FilePath rootdir)
private

◆ ~IOMan()

IOMan::~IOMan ( )
private

Member Function Documentation

◆ addCustomDataDir()

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

◆ applClosing()

void IOMan::applClosing ( )
inlineprivate

◆ cancelTempSurvey()

static void IOMan::cancelTempSurvey ( )
static

◆ cancelTempSurvey_()

uiRetVal IOMan::cancelTempSurvey_ ( )

◆ changeSurveyBlocked()

bool IOMan::changeSurveyBlocked ( ) const
inline

◆ close()

bool IOMan::close ( bool  dotrigger)
private

◆ commitChanges()

bool IOMan::commitChanges ( const IOObj )

◆ createNewKey()

MultiID IOMan::createNewKey ( const MultiID dirkey)

◆ crWriteIOObj()

IOObj* IOMan::crWriteIOObj ( const CtxtIOObj ,
const MultiID ,
int   
) const
private

◆ curDirName()

const char* IOMan::curDirName ( ) const

OS dir name.

◆ curLevel()

int IOMan::curLevel ( ) const
inlineprivate

◆ doReloc()

bool IOMan::doReloc ( const MultiID ,
Translator ,
IOStream ,
IOStream  
)
private

◆ ensureUniqueName()

bool IOMan::ensureUniqueName ( IOObj )

◆ fullSurveyPath()

mDeprecatedObs BufferString IOMan::fullSurveyPath ( ) const

◆ get() [1/4]

IOObj* IOMan::get ( const char *  objname,
const char *  tgname 
) const

◆ get() [2/4]

IOObj* IOMan::get ( const DBKey ) const

Next functions return a new (unmanaged) IOObj.

◆ get() [3/4]

IOObj* IOMan::get ( const IOObjContext ,
const char *  objnm 
) const

◆ get() [4/4]

IOObj* IOMan::get ( const MultiID ) const

◆ getDir() [1/3]

IODir* IOMan::getDir ( const char *  trlgrpnm) const

◆ getDir() [2/3]

IODir* IOMan::getDir ( const MultiID ) const

◆ getDir() [3/3]

IODir* IOMan::getDir ( IOObjContext::StdSelType  ) const

◆ getEntry()

void IOMan::getEntry ( CtxtIOObj ,
bool  newistmp = false,
int  translidxingroup = -1 
)

will create a new entry if necessary

◆ getFirst()

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

if interested in nrpresent pass valid address

◆ getFromPar()

IOObj* IOMan::getFromPar ( const IOPar ,
const char *  basekey,
const IOObjContext ,
bool  mknew,
BufferString errmsg 
) const

◆ getIfOnlyOne()

IOObj* IOMan::getIfOnlyOne ( const char *  trgroupname)
inline

◆ getIOSubDir()

static IOSubDir* IOMan::getIOSubDir ( const CustomDirData )
static

◆ getLocal()

IOObj* IOMan::getLocal ( const char *  objname,
const char *  tgname 
) const

◆ getNewEntry()

void IOMan::getNewEntry ( CtxtIOObj ,
bool  newistmp = false,
int  translidxingroup = -1 
)

will create a new entry if necessary

◆ getNewTempDataRootDir()

static BufferString IOMan::getNewTempDataRootDir ( )
static

◆ getObjectNames()

static void IOMan::getObjectNames ( const DBKeySet ,
BufferStringSet  
)
static

◆ getObjEntry()

void IOMan::getObjEntry ( CtxtIOObj ,
bool  isnew,
bool  newistmp = false,
int  translidxingroup = -1 
)
private

◆ getOfGroup()

IOObj* IOMan::getOfGroup ( const char *  tgname,
bool  first = true,
bool  onlyifsingle = false 
) const

◆ implExists()

bool IOMan::implExists ( const MultiID ) const

◆ implIsLink()

bool IOMan::implIsLink ( const MultiID ) const

◆ implReloc()

bool IOMan::implReloc ( const MultiID ,
const char *  newdir 
)

◆ implRemove() [1/2]

bool IOMan::implRemove ( const IOObj ,
bool  deep = true 
) const

◆ implRemove() [2/2]

bool IOMan::implRemove ( const MultiID ,
bool  rmentry = false,
uiRetVal uirv = nullptr 
)

◆ implRename()

bool IOMan::implRename ( const MultiID ,
const char *  newnm 
)

◆ implUpdated()

CNotifier<IOMan,const MultiID&>& IOMan::implUpdated ( )

◆ init() [1/2]

mDeprecatedObs void IOMan::init ( )
private

◆ init() [2/2]

void IOMan::init ( SurveyInfo newsi)
private

◆ iomReady()

static Notifier<IOMan>& IOMan::iomReady ( )
static

◆ isBad()

bool IOMan::isBad ( ) const
inline

◆ isKey()

bool IOMan::isKey ( const char *  keystr) const

◆ isOK()

static bool IOMan::isOK ( )
static

◆ isPreparedForSurveyChange()

static bool IOMan::isPreparedForSurveyChange ( )
static

◆ isPresent() [1/2]

bool IOMan::isPresent ( const char *  ,
const char *  tgname = 0 
) const

Use before creating a named object

Parameters
tgnameexample: EMHorizon3DTranslatorGroup::sGroupName().str()

◆ isPresent() [2/2]

bool IOMan::isPresent ( const MultiID ) const

◆ isReadOnly()

bool IOMan::isReadOnly ( const MultiID ) const

◆ isReady()

bool IOMan::isReady ( ) const

◆ isUsable() [1/2]

bool IOMan::isUsable ( const DBKey ) const

◆ isUsable() [2/2]

bool IOMan::isUsable ( const MultiID ) const

◆ isUsingTempSurvey()

bool IOMan::isUsingTempSurvey ( ) const

◆ isValidDataRoot()

static bool IOMan::isValidDataRoot ( const char *  dirnm)
static

Full path to a writable directory.

◆ isValidMsg()

static uiRetVal IOMan::isValidMsg ( )
static

◆ isValidSurveyDir()

static bool IOMan::isValidSurveyDir ( const char *  dirnm)
static

Full path to an OpendTect project directory.

◆ key()

const MultiID& IOMan::key ( ) const

of current IODir

◆ levelOf()

int IOMan::levelOf ( const char *  dirnm) const
private

◆ message()

const OD::String& IOMan::message ( ) const
inline

◆ nameOf() [1/2]

const char* IOMan::nameOf ( const char *  keystr) const

if keystr is not an IOObj key, will return keystr

◆ nameOf() [2/2]

const char* IOMan::nameOf ( const MultiID ) const

◆ newSurvey()

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

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

◆ objectName()

const char* IOMan::objectName ( const DBKey ) const

◆ permRemove()

bool IOMan::permRemove ( const MultiID )

Removes only entry in IODir.

◆ prepareDataRoot()

static bool IOMan::prepareDataRoot ( const char *  dirnm)
static

◆ prepareSurveyChange()

Notifier<IOMan>& IOMan::prepareSurveyChange ( )

Prepare, don't tear down.

◆ recordDataSource()

bool IOMan::recordDataSource ( const SurveyDiskLocation ,
uiRetVal  
) const

◆ recordDataSource_()

static bool IOMan::recordDataSource_ ( const SurveyDiskLocation ,
uiRetVal  
)
static

records dataroot in settings, and project in survey file

◆ reInit() [1/2]

mDeprecatedObs void IOMan::reInit ( bool  dotrigger)
private

◆ reInit() [2/2]

void IOMan::reInit ( SurveyInfo newsi)
private

◆ removeUnusable()

void IOMan::removeUnusable ( DBKeySet )

◆ rootDir()

const char* IOMan::rootDir ( ) const
inline

Full path to the root of the current project.

◆ setChangeSurveyBlocked()

void IOMan::setChangeSurveyBlocked ( bool  yn)
inline

◆ setDataSource() [1/4]

uiRetVal IOMan::setDataSource ( const char *  dataroot,
const char *  survdir,
bool  refresh = false 
)

◆ setDataSource() [2/4]

uiRetVal IOMan::setDataSource ( const char *  fullpath,
bool  refresh = false 
)

◆ setDataSource() [3/4]

uiRetVal IOMan::setDataSource ( const CommandLineParser ,
bool  refresh = false 
)

◆ setDataSource() [4/4]

uiRetVal IOMan::setDataSource ( const IOPar ,
bool  refresh = false 
)

◆ setDataSource_() [1/3]

static uiRetVal IOMan::setDataSource_ ( const char *  dataroot,
const char *  survdir,
bool  refresh = false 
)
static

Triggers the post-survey change notifiers

◆ setDataSource_() [2/3]

static uiRetVal IOMan::setDataSource_ ( const char *  fullpath,
bool  refresh = false 
)
static

◆ setDataSource_() [3/3]

static uiRetVal IOMan::setDataSource_ ( const CommandLineParser ,
bool  refresh = false 
)
static

◆ setDir()

bool IOMan::setDir ( const char *  )
private

◆ setRootDir() [1/2]

bool IOMan::setRootDir ( const char *  )

fullPath to the survey directory pass nullptr to use GetDataDir

◆ setRootDir() [2/2]

uiRetVal IOMan::setRootDir ( const FilePath ,
bool  ischecked = false 
)
private

fullPath to the survey directory

◆ setSurvey()

static bool IOMan::setSurvey ( const char *  )
static

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

◆ setTempSurvey()

static void IOMan::setTempSurvey ( const SurveyDiskLocation )
static

◆ setTempSurvey_()

uiRetVal IOMan::setTempSurvey_ ( const SurveyDiskLocation )

◆ setupCustomDataDirs()

static void IOMan::setupCustomDataDirs ( int  )
staticprivate

◆ surveyName()

const char* IOMan::surveyName ( ) const

◆ surveyParsChanged()

static void IOMan::surveyParsChanged ( )
static

◆ to() [1/3]

bool IOMan::to ( const IOSubDir ,
bool   
)
private

◆ to() [2/3]

bool IOMan::to ( const MultiID ,
bool  force_reread = false 
)

◆ to() [3/3]

bool IOMan::to ( IOObjContext::StdSelType  ,
bool  force_reread = false 
)

◆ toRoot()

bool IOMan::toRoot ( bool  force_reread = false)
inline

◆ uiMessage()

const uiString& IOMan::uiMessage ( ) const
inline

◆ validSurveySetup()

static bool IOMan::validSurveySetup ( BufferString errmsg)
static

◆ writeSettingsSurveyFile()

bool IOMan::writeSettingsSurveyFile ( const char *  dirnm,
uiRetVal  
) const
private

◆ writeSettingsSurveyFile_()

static bool IOMan::writeSettingsSurveyFile_ ( const char *  dirnm,
uiRetVal  
)
staticprivate

Friends And Related Function Documentation

◆ BatchProgram

friend class BatchProgram
friend

◆ IOM

IOMan& IOM ( )
friend

◆ IOMManager

friend class IOMManager
friend

◆ ServiceMgrBase

friend class ServiceMgrBase
friend

◆ SurveyDataTreePreparer

friend class SurveyDataTreePreparer
friend

◆ uiMain

friend class uiMain
friend

Member Data Documentation

◆ afterSurveyChange

Notifier<IOMan> IOMan::afterSurveyChange

When operating in normal state.

◆ applicationClosing

Notifier<IOMan> IOMan::applicationClosing

'Final' call ...

◆ curlvl_

int IOMan::curlvl_
private

◆ dirptr_

IODir* IOMan::dirptr_ = nullptr
private

◆ entryAdded

CNotifier<IOMan, const MultiID&> IOMan::entryAdded

◆ entryChanged

CNotifier<IOMan, const MultiID&> IOMan::entryChanged

◆ entryRemoved

CNotifier<IOMan, const MultiID&> IOMan::entryRemoved

◆ lock_

Threads::Lock IOMan::lock_
mutableprivate

◆ msg_

uiString IOMan::msg_
private

◆ newIODir

Notifier<IOMan> IOMan::newIODir

◆ rootdir_

BufferString IOMan::rootdir_
private

◆ state_

State IOMan::state_ = NeedInit
private

◆ survchgblocked_

bool IOMan::survchgblocked_ = false
private

◆ surveyChanged

Notifier<IOMan> IOMan::surveyChanged

To restore OD to normal state.

◆ surveyToBeChanged

Notifier<IOMan> IOMan::surveyToBeChanged

Before the change, tear down.

◆ theinst_

IOMan* IOMan::theinst_
staticprivate

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