OpendTect  7.0
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Translator Class Referenceabstract

I/O Interpreter class for a certain object type. More...

Inheritance diagram for Translator:
[legend]

Public Member Functions

 Translator (const char *nm, const char *usr_nm)
 
virtual ~Translator ()
 
virtual const char * connType () const
 
virtual IOObjcreateWriteIOObj (const IOObjContext &, const MultiID &) const
 
virtual const char * defExtension () const
 
virtual bool getConfirmRemoveMsg (const IOObj *, uiString &msg, uiString &canceltxt, uiString &deepremovetxt, uiString &shallowremovetxt) const
 
const char * getDisplayName () const
 "username [group]" More...
 
virtual TranslatorgetNew () const =0
 
const TranslatorGroupgroup () const
 
virtual const char * iconName () const
 
virtual bool implExists (const IOObj *, bool forread) const
 
virtual bool implIsLink (const IOObj *) const
 
virtual bool implReadOnly (const IOObj *) const
 
virtual bool implRemove (const IOObj *, bool deep=true) const
 
virtual bool implRename (const IOObj *, const char *newnm) const
 
virtual bool implSetReadOnly (const IOObj *, bool) const
 
virtual bool isUserSelectable (bool forread=true) const
 
virtual const uiStringmessage () const
 
void setGroup (TranslatorGroup *g)
 
uiString sSelObjectIsWrongType ()
 
const OD::StringtypeName () const
 
virtual void usePar (const IOPar &)
 
const OD::StringuserName () 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 ()
 

Static Public Member Functions

static const TranslatorgetTemplateInstance (const char *displayname)
 
static uiString sBadConnection ()
 
static uiString sNoIoobjMsg ()
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Static Protected Member Functions

static BufferString getAssociatedFileName (const char *fnm, const char *extension)
 
static BufferString getAssociatedFileName (const IOObj &, const char *extension)
 
static bool removeAssociatedFile (const char *fnm, const char *ext)
 
static bool renameAssociatedFile (const char *fnm, const char *ext, const char *newnm)
 
static bool renameLargeFile (const char *fnm, const char *newfnm, const CallBack *cb=nullptr)
 
static bool setPermAssociatedFile (const char *fnm, const char *ext, bool setwritable)
 

Protected Attributes

TranslatorGroupgroup_ = nullptr
 
uiString msg_
 
BufferString typname_
 
BufferString usrname_
 

Detailed Description

I/O Interpreter class for a certain object type.

Every concept (Well, Seismic data, etc.) should have its own Translator base class. Together with the Group, you then get 2 + N classes per concept: XxxTranslatorGroup XxxTranslator yyyXxxTranslator The XxxTranslator defines the 'protocol' for reading and writing objects of this type. Actual I/O will always be done through a pointer to that type.

Important: use the macros at the end of this header file to declare and define every Translator(Group)-related class.

<>

Constructor & Destructor Documentation

◆ Translator()

Translator::Translator ( const char *  nm,
const char *  usr_nm 
)

◆ ~Translator()

virtual Translator::~Translator ( )
inlinevirtual

Member Function Documentation

◆ connType()

virtual const char* Translator::connType ( ) const
virtual

Reimplemented in SeisPSCubeSeisTrcTranslator.

◆ createWriteIOObj()

virtual IOObj* Translator::createWriteIOObj ( const IOObjContext ,
const MultiID  
) const
virtual

Reimplemented in SEGYDirectSeisTrcTranslator.

◆ defExtension()

virtual const char* Translator::defExtension ( ) const
virtual

◆ getAssociatedFileName() [1/2]

static BufferString Translator::getAssociatedFileName ( const char *  fnm,
const char *  extension 
)
staticprotected

◆ getAssociatedFileName() [2/2]

static BufferString Translator::getAssociatedFileName ( const IOObj ,
const char *  extension 
)
staticprotected

◆ getConfirmRemoveMsg()

virtual bool Translator::getConfirmRemoveMsg ( const IOObj ,
uiString msg,
uiString canceltxt,
uiString deepremovetxt,
uiString shallowremovetxt 
) const
virtual

if deepremove option is selected by user, the implRemove call gets deep=true

Reimplemented in CBVSSeisTrcTranslator, SEGYDirectSeisTrc2DTranslator, and SEGYDirectSeisTrcTranslator.

◆ getDisplayName()

const char* Translator::getDisplayName ( ) const

"username [group]"

◆ getNew()

virtual Translator* Translator::getNew ( ) const
pure virtual

◆ getTemplateInstance()

static const Translator* Translator::getTemplateInstance ( const char *  displayname)
static

◆ group()

const TranslatorGroup* Translator::group ( ) const
inline

◆ iconName()

virtual const char* Translator::iconName ( ) const
inlinevirtual

◆ implExists()

virtual bool Translator::implExists ( const IOObj ,
bool  forread 
) const
virtual

◆ implIsLink()

virtual bool Translator::implIsLink ( const IOObj ) const
virtual

◆ implReadOnly()

virtual bool Translator::implReadOnly ( const IOObj ) const
virtual

◆ implRemove()

virtual bool Translator::implRemove ( const IOObj ,
bool  deep = true 
) const
virtual

◆ implRename()

virtual bool Translator::implRename ( const IOObj ,
const char *  newnm 
) const
virtual

◆ implSetReadOnly()

virtual bool Translator::implSetReadOnly ( const IOObj ,
bool   
) const
virtual

◆ isUserSelectable()

virtual bool Translator::isUserSelectable ( bool  forread = true) const
inlinevirtual

◆ message()

virtual const uiString& Translator::message ( ) const
inlinevirtual

◆ removeAssociatedFile()

static bool Translator::removeAssociatedFile ( const char *  fnm,
const char *  ext 
)
staticprotected

◆ renameAssociatedFile()

static bool Translator::renameAssociatedFile ( const char *  fnm,
const char *  ext,
const char *  newnm 
)
staticprotected

◆ renameLargeFile()

static bool Translator::renameLargeFile ( const char *  fnm,
const char *  newfnm,
const CallBack cb = nullptr 
)
staticprotected

◆ sBadConnection()

static uiString Translator::sBadConnection ( )
static

◆ setGroup()

void Translator::setGroup ( TranslatorGroup g)
inline

◆ setPermAssociatedFile()

static bool Translator::setPermAssociatedFile ( const char *  fnm,
const char *  ext,
bool  setwritable 
)
staticprotected

◆ sNoIoobjMsg()

static uiString Translator::sNoIoobjMsg ( )
static

◆ sSelObjectIsWrongType()

uiString Translator::sSelObjectIsWrongType ( )

◆ typeName()

const OD::String& Translator::typeName ( ) const
inline

◆ usePar()

virtual void Translator::usePar ( const IOPar )
inlinevirtual

◆ userName()

const OD::String& Translator::userName ( ) const
inline

Member Data Documentation

◆ group_

TranslatorGroup* Translator::group_ = nullptr
protected

◆ msg_

uiString Translator::msg_
protected

◆ typname_

BufferString Translator::typname_
protected

◆ usrname_

BufferString Translator::usrname_
protected

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