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

Classes

class  CustomDirData
 

Public Member Functions

void applClosing ()
 
bool changeSurveyBlocked () const
 
bool commitChanges (const IOObj &)
 
MultiID createNewKey (const MultiID &dirkey)
 
const char * curDirName () const
 OS dir name. More...
 
bool ensureUniqueName (IOObj &)
 
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 implReloc (const MultiID &, const char *newdir, const CallBack *cb=nullptr)
 
bool implRemove (const IOObj &) const
 
bool implRemove (const MultiID &, bool rmentry=false, uiRetVal *uirv=nullptr)
 
bool implRename (const MultiID &, const char *newnm, const CallBack *cb=nullptr)
 
bool isBad () const
 
bool isKey (const char *keystr) const
 
bool isManagedObject (const MultiID &) 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
 
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 * objectName (const DBKey &) const
 
bool permRemove (const MultiID &)
 Removes only entry in IODir. More...
 
bool recordDataSource (const SurveyDiskLocation &, uiRetVal &) const
 
void removeUnusable (DBKeySet &)
 
const char * rootDir () const
 
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 *)
 
const char * surveyName () const
 
bool to (const MultiID &, bool force_reread=false)
 
bool toRoot (bool force_reread=false)
 
- 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
 
- 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 &)
 
virtual const name_typename () const
 
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 bool isValidDataRoot (const char *dirnm)
 
static bool isValidSurveyDir (const char *dirnm)
 
static bool newSurvey (SurveyInfo *newsi=0)
 
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...
 
Notifier< IOManentryAdded
 
Notifier< IOManentryChanged
 
Notifier< IOManentryRemoved
 CallBacker: CBCapsule<MultiID> More...
 
Notifier< IOMannewIODir
 
Notifier< IOMansurveyChanged
 To restore OD to normal state. More...
 
Notifier< IOMansurveyToBeChanged
 Before the change. More...
 

Private Types

enum  State { Bad , NeedInit , Good }
 

Private Member Functions

 IOMan (const char *rd=0)
 
 ~IOMan ()
 
IOObjcrWriteIOObj (const CtxtIOObj &, const MultiID &, int) const
 
int curLevel () const
 
bool doReloc (const MultiID &, Translator *, IOStream &, IOStream &, const CallBack *cb=nullptr)
 
void getObjEntry (CtxtIOObj &, bool isnew, bool newistmp=false, int translidxingroup=-1)
 
int getSuffixForName (const BufferString &orgnm, const BufferString &trgrpnm, int idx=0)
 
void init ()
 
int levelOf (const char *dirnm) const
 
void reInit (bool dotrigger)
 
bool setDir (const char *)
 
bool to (const IOSubDir *, bool)
 
bool writeSettingsSurveyFile (const char *dirnm, uiRetVal &) const
 

Static Private Member Functions

static void setupCustomDataDirs (int)
 

Private Attributes

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

Static Private Attributes

static IOMantheinst_
 

Friends

IOManIOM ()
 
class IOMManager
 
class SurveyDataTreePreparer
 

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()

IOMan::IOMan ( const char *  rd = 0)
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 ( )
inline

◆ cancelTempSurvey()

static void IOMan::cancelTempSurvey ( )
static

◆ changeSurveyBlocked()

bool IOMan::changeSurveyBlocked ( ) const
inline

◆ 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 ,
const CallBack cb = nullptr 
)
private

◆ ensureUniqueName()

bool IOMan::ensureUniqueName ( IOObj )

◆ fullSurveyPath()

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

◆ 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

◆ getSuffixForName()

int IOMan::getSuffixForName ( const BufferString orgnm,
const BufferString trgrpnm,
int  idx = 0 
)
private

◆ implExists()

bool IOMan::implExists ( const MultiID ) const

◆ implReloc()

bool IOMan::implReloc ( const MultiID ,
const char *  newdir,
const CallBack cb = nullptr 
)

◆ implRemove() [1/2]

bool IOMan::implRemove ( const IOObj ) const

◆ implRemove() [2/2]

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

◆ implRename()

bool IOMan::implRename ( const MultiID ,
const char *  newnm,
const CallBack cb = nullptr 
)

◆ init()

void IOMan::init ( )
private

◆ isBad()

bool IOMan::isBad ( ) const
inline

◆ isKey()

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

◆ isManagedObject()

bool IOMan::isManagedObject ( const MultiID ) const

◆ 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

◆ isValidDataRoot()

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

◆ isValidSurveyDir()

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

◆ 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()

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

if keystr is not an IOObj key, will return keystr

◆ newSurvey()

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

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

◆ objectName()

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

◆ permRemove()

bool IOMan::permRemove ( const MultiID )

Removes only entry in IODir.

◆ recordDataSource()

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

records dataroot in settings, and project in survey file

◆ reInit()

void IOMan::reInit ( bool  dotrigger)
private

◆ removeUnusable()

void IOMan::removeUnusable ( DBKeySet )

◆ rootDir()

const char* IOMan::rootDir ( ) const
inline

◆ setChangeSurveyBlocked()

void IOMan::setChangeSurveyBlocked ( bool  yn)
inline

◆ setDataSource() [1/4]

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

Triggers the post-survey change notifiers

◆ 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 
)

◆ setDir()

bool IOMan::setDir ( const char *  )
private

◆ setRootDir()

bool IOMan::setRootDir ( const char *  )

◆ 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

◆ setupCustomDataDirs()

static void IOMan::setupCustomDataDirs ( int  )
staticprivate

◆ surveyName()

const char* IOMan::surveyName ( ) const

◆ surveyParsChanged()

static void IOMan::surveyParsChanged ( )
static

◆ to() [1/2]

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

◆ to() [2/2]

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

◆ toRoot()

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

◆ validSurveySetup()

static bool IOMan::validSurveySetup ( BufferString errmsg)
static

◆ writeSettingsSurveyFile()

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

Friends And Related Function Documentation

◆ IOM

IOMan& IOM ( )
friend

◆ IOMManager

friend class IOMManager
friend

◆ SurveyDataTreePreparer

friend class SurveyDataTreePreparer
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_
private

◆ entryAdded

Notifier<IOMan> IOMan::entryAdded

◆ entryChanged

Notifier<IOMan> IOMan::entryChanged

◆ entryRemoved

Notifier<IOMan> IOMan::entryRemoved

CallBacker: CBCapsule<MultiID>

◆ lock_

Threads::Lock IOMan::lock_
mutableprivate

◆ msg_

BufferString IOMan::msg_
private

◆ newIODir

Notifier<IOMan> IOMan::newIODir

◆ rootdir_

BufferString IOMan::rootdir_
private

◆ state_

State IOMan::state_
private

◆ survchgblocked_

bool IOMan::survchgblocked_
private

◆ surveyChanged

Notifier<IOMan> IOMan::surveyChanged

To restore OD to normal state.

◆ surveyToBeChanged

Notifier<IOMan> IOMan::surveyToBeChanged

Before the change.

◆ theinst_

IOMan* IOMan::theinst_
staticprivate

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