OpendTect  6.3
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
DBMan Class Reference

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

Inheritance diagram for DBMan:
[legend]

Classes

class  CustomDirData
 

Public Types

typedef DBKey::DirID DirID
 
typedef DBKey::ObjID ObjID
 
- Public Types inherited from Monitorable
typedef int ChangeType
 
typedef int64_t IDType
 
typedef int64_t DirtyCountType
 
typedef CNotifier< Monitorable, ChangeDataChangeDataNotifier
 

Public Member Functions

bool isPresent (DBKey) const
 
bool isPresent (const char *, const char *tgname) const
 
BufferString nameOf (DBKey) const
 
BufferString nameFor (const char *keystr) const
 if keystr is not an IOObj key, will return keystr More...
 
IOObjget (DBKey) const
 
IOObjgetFirst (const IOObjContext &, int *nrpresent=0) const
 
IOObjgetFromPar (const IOPar &, const char *basekey, const IOObjContext &, bool mknew, uiString &errmsg) const
 
IOObjgetByName (IOObjContext::StdSelType, const char *objname, const char *tgname=0) const
 
IOObjgetByName (const IOObjContext &, const char *objnm) const
 
IOObjgetByName (const char *objname, const char *tgname) const
 
void getEntry (CtxtIOObj &, bool ifnewmakeittemp=false, int translidxingroup=-1)
 will create a new entry if necessary More...
 
bool setEntry (const IOObj &)
 
bool removeEntry (DBKey)
 
ConstRefMan< DBDirfetchDir (DirID) const
 
ConstRefMan< DBDirfetchDir (IOObjContext::StdSelType) const
 
ConstRefMan< DBDirfetchDir (const IOObjContext &) const
 
ConstRefMan< DBDirfetchRootDir () const
 
BufferString survDir () const
 
BufferString surveyName () const
 
BufferString surveyDirectoryName () const
 
bool isKeyString (const char *) const
 
bool isBad () const
 
uiString errMsg () const
 
BufferString getDirectoryNameOf (DirID, bool fullpath) const
 
void findTempObjs (ObjectSet< IOObj > &, const IOObjSelConstraints *cnstrts=0) const
 set filled with cloned ioobjs. Needs deepErase(). More...
 
void setSurveyChangeUserAbort ()
 
void setSurveyChangeAbortReason (uiRetVal)
 
void applClosing ()
 
mDeprecated bool permRemove (const DBKey &ky)
 
mDeprecated bool commitChanges (const IOObj &ioobj)
 
mDeprecated BufferString rootDir () const
 
uiRetVal setDataSource (const char *fullpath_of_survey_dir, bool forcerefresh=false)
 Plugins need to use uiDataRootSel::setSurveyDirTo. More...
 
uiRetVal setDataSource (const IOPar &, bool forcerefresh=false)
 
uiRetVal reRead ()
 Should not be necessary. More...
 
- Public Member Functions inherited from Monitorable
 Monitorable (const Monitorable &)
 
virtual ~Monitorable ()
 
Monitorableoperator= (const Monitorable &)
 
bool operator== (const Monitorable &) const
 
virtual Monitorableclone () const
 
virtual ChangeDataNotifierobjectChanged () const
 
virtual Notifier< Monitorable > & objectToBeDeleted () const
 
virtual void touch () const
 
virtual DirtyCountType dirtyCount () const
 
virtual ChangeType compareWith (const Monitorable &) const
 
void sendChangeNotification (const ChangeData &) const
 
void sendEntireObjectChangeNotification () const
 
void transferNotifsTo (const Monitorable &, const CallBacker *onlyfor=0) 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 detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
virtual bool isCapsule () const
 
void stopReceivingNotifications () const
 

Static Public Member Functions

static uiRetVal addCustomDataDir (const CustomDirData &)
 
static uiRetVal isValidDataRoot (const char *dirnm)
 
static uiRetVal isValidSurveyDir (const char *dirnm)
 
static uiRetVal checkSurveySetupValid ()
 
- Static Public Member Functions inherited from Monitorable
static Notifier< Monitorable > & instanceCreated ()
 defines static instanceCreated() More...
 
static ChangeType cEntireObjectChange ()
 
static ChangeType cNoChange ()
 
static IDType cUnspecChgID ()
 
static IDType cEntireObjectChgID ()
 
static ChangeType changeNotificationTypeOf (CallBacker *)
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Public Attributes

Notifier< DBMansurveyToBeChanged
 Before the change. More...
 
Notifier< DBMansurveyChanged
 To restore OD to normal state. More...
 
Notifier< DBManafterSurveyChange
 When operating in normal state. More...
 
Notifier< DBManapplicationClosing
 'Final' call ... More...
 
CNotifier< DBMan, DBKeyentryAdded
 
CNotifier< DBMan, DBKeyentryRemoved
 
CNotifier< DBMan, DBKeyentryToBeRemoved
 
Notifier< DBMansurveyChangeOK
 

Private Member Functions

 mODTextTranslationClass (DBMan)
 
 DBMan ()
 
 ~DBMan ()
 
DBMangetClone () const
 
uiRetVal handleNewSurvDir ()
 
void leaveSurvey ()
 
void readDirs ()
 
RefMan< DBDirgetDBDir (DirID)
 
DBDirgtDir (DirID) const
 
uiRetVal setupCustomDataDirs (int)
 
void setupCustomDataDir (const CustomDirData &, uiRetVal &)
 
IOObjcrWriteIOObj (const CtxtIOObj &, DBKey, int trlidx) const
 
void dbdirChgCB (CallBacker *)
 
uiRetVal setDataSource (const char *, const char *, bool)
 
void initFirst ()
 
uiRetVal doReRead ()
 

Private Attributes

BufferString survdir_
 
DBDirrootdbdir_
 
ObjectSet< DBDirdbdirs_
 
uiString errmsg_
 
bool surveychangeuserabort_
 
uiRetVal surveychangeabortreason_
 

Friends

class GeneralModuleIniter
 
DBManDBM ()
 

Additional Inherited Members

- Protected Types inherited from Monitorable
typedef Threads::Atomic< DirtyCountTypeDirtyCounter
 
- Protected Member Functions inherited from Monitorable
 Monitorable ()
 
void copyAll (const Monitorable &)
 
void sendChgNotif (AccessLocker &, const ChangeData &) const
 calls objectChanged with released lock More...
 
void sendChgNotif (AccessLocker &, ChangeType, IDType) const
 calls objectChanged with released lock More...
 
void sendDelNotif () const
 
void stopChangeNotifications () const
 
void resumeChangeNotifications () const
 
template<class T >
getMemberSimple (const T &) const
 the get function used by mImplSimpleMonitoredGet More...
 
template<class TMember , class TSetTo >
void setMemberSimple (TMember &, TSetTo, ChangeType, IDType)
 the set function used by mImplSimpleMonitoredSet More...
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
- Protected Attributes inherited from Monitorable
Threads::Lock accesslock_
 

Detailed Description

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

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

Member Typedef Documentation

typedef DBKey::ObjID DBMan::ObjID

Constructor & Destructor Documentation

DBMan::DBMan ( )
private
DBMan::~DBMan ( )
private

Member Function Documentation

static uiRetVal DBMan::addCustomDataDir ( const CustomDirData )
static

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

void DBMan::applClosing ( )
inline
static uiRetVal DBMan::checkSurveySetupValid ( )
static
mDeprecated bool DBMan::commitChanges ( const IOObj ioobj)
inline
IOObj* DBMan::crWriteIOObj ( const CtxtIOObj ,
DBKey  ,
int  trlidx 
) const
private
void DBMan::dbdirChgCB ( CallBacker )
private
uiRetVal DBMan::doReRead ( )
private
uiString DBMan::errMsg ( ) const
inline
ConstRefMan<DBDir> DBMan::fetchDir ( DirID  ) const
ConstRefMan<DBDir> DBMan::fetchDir ( IOObjContext::StdSelType  ) const
ConstRefMan<DBDir> DBMan::fetchDir ( const IOObjContext ) const
ConstRefMan<DBDir> DBMan::fetchRootDir ( ) const
inline
void DBMan::findTempObjs ( ObjectSet< IOObj > &  ,
const IOObjSelConstraints cnstrts = 0 
) const

set filled with cloned ioobjs. Needs deepErase().

IOObj* DBMan::get ( DBKey  ) const
IOObj* DBMan::getByName ( IOObjContext::StdSelType  ,
const char *  objname,
const char *  tgname = 0 
) const
IOObj* DBMan::getByName ( const IOObjContext ,
const char *  objnm 
) const
IOObj* DBMan::getByName ( const char *  objname,
const char *  tgname 
) const
DBMan* DBMan::getClone ( ) const
inlineprivatevirtual

Implements Monitorable.

RefMan<DBDir> DBMan::getDBDir ( DirID  )
private
BufferString DBMan::getDirectoryNameOf ( DirID  ,
bool  fullpath 
) const
void DBMan::getEntry ( CtxtIOObj ,
bool  ifnewmakeittemp = false,
int  translidxingroup = -1 
)

will create a new entry if necessary

IOObj* DBMan::getFirst ( const IOObjContext ,
int *  nrpresent = 0 
) const
IOObj* DBMan::getFromPar ( const IOPar ,
const char *  basekey,
const IOObjContext ,
bool  mknew,
uiString errmsg 
) const
DBDir* DBMan::gtDir ( DirID  ) const
private
uiRetVal DBMan::handleNewSurvDir ( )
private
void DBMan::initFirst ( )
private
bool DBMan::isBad ( ) const
bool DBMan::isKeyString ( const char *  ) const
bool DBMan::isPresent ( DBKey  ) const
bool DBMan::isPresent ( const char *  ,
const char *  tgname 
) const
static uiRetVal DBMan::isValidDataRoot ( const char *  dirnm)
static
static uiRetVal DBMan::isValidSurveyDir ( const char *  dirnm)
static
void DBMan::leaveSurvey ( )
private
DBMan::mODTextTranslationClass ( DBMan  )
private
BufferString DBMan::nameFor ( const char *  keystr) const

if keystr is not an IOObj key, will return keystr

BufferString DBMan::nameOf ( DBKey  ) const
mDeprecated bool DBMan::permRemove ( const DBKey ky)
inline
void DBMan::readDirs ( )
private
bool DBMan::removeEntry ( DBKey  )
uiRetVal DBMan::reRead ( )

Should not be necessary.

mDeprecated BufferString DBMan::rootDir ( ) const
inline
uiRetVal DBMan::setDataSource ( const char *  ,
const char *  ,
bool   
)
private
uiRetVal DBMan::setDataSource ( const char *  fullpath_of_survey_dir,
bool  forcerefresh = false 
)

Plugins need to use uiDataRootSel::setSurveyDirTo.

uiRetVal DBMan::setDataSource ( const IOPar ,
bool  forcerefresh = false 
)

uses sKey::dataRoot() and sKey::Survey() Intended for stand-alone programs

bool DBMan::setEntry ( const IOObj )
void DBMan::setSurveyChangeAbortReason ( uiRetVal  )
void DBMan::setSurveyChangeUserAbort ( )
void DBMan::setupCustomDataDir ( const CustomDirData ,
uiRetVal  
)
private
uiRetVal DBMan::setupCustomDataDirs ( int  )
private
BufferString DBMan::survDir ( ) const
inline
BufferString DBMan::surveyDirectoryName ( ) const
BufferString DBMan::surveyName ( ) const

Friends And Related Function Documentation

DBMan& DBM ( )
friend
friend class GeneralModuleIniter
friend

Member Data Documentation

Notifier<DBMan> DBMan::afterSurveyChange

When operating in normal state.

Notifier<DBMan> DBMan::applicationClosing

'Final' call ...

ObjectSet<DBDir> DBMan::dbdirs_
private
CNotifier<DBMan,DBKey> DBMan::entryAdded
CNotifier<DBMan,DBKey> DBMan::entryRemoved
CNotifier<DBMan,DBKey> DBMan::entryToBeRemoved
uiString DBMan::errmsg_
mutableprivate
DBDir* DBMan::rootdbdir_
private
BufferString DBMan::survdir_
private
uiRetVal DBMan::surveychangeabortreason_
private
Notifier<DBMan> DBMan::surveyChanged

To restore OD to normal state.

Notifier<DBMan> DBMan::surveyChangeOK
bool DBMan::surveychangeuserabort_
private
Notifier<DBMan> DBMan::surveyToBeChanged

Before the change.


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