OpendTect-6_4  6.4
Classes | Macros | Functions
transl.h File Reference
Include dependency graph for transl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TranslatorGroup
 Group of Translators. Has a static factory. More...
 
class  Translator
 I/O Interpreter class for a certain object type. More...
 

Macros

#define mDGBKey   "dGB"
 
#define mdTectKey   "dTect"
 
#define mObjSelUnrelated   0
 
#define mObjSelRelated   1
 
#define mObjSelMatch   2
 
#define mImplTranslatorInitClass(spec, clss, usrnm)
 
#define mImplTranslatorGroupTheInst(clss)
 
#define isTranslatorGroupBody(clss)
 In the class definition of a TranslatorGroup class. More...
 
#define isTranslatorGroup(clss)
 
#define isTranslatorGroupWithInst(clss)
 
#define isTranslatorBody(spec, clss)
 In the class definition of a Translator class. More...
 
#define isTranslator(spec, clss)   isTranslatorBody( spec, clss );
 
#define mIsTranslatorWithInitClass(spec, clss, usrnm)
 
#define defineTranslatorGroup(clss, groupname)
 In the source file of a TranslatorGroup class. More...
 
#define defineTranslator(spec, clss, usrnm)
 In the source file of a Translator class. More...
 
#define mDefEmptyTranslatorGroupConstructor(clss)
 
#define mDefEmptyTranslatorBaseConstructor(clss)
 
#define mDefEmptyTranslatorConstructor(spec, clss)
 
#define mDeclEmptyTranslatorBundle(mod, clss, fmt, defext)
 
#define mDefSimpleTranslatorInstances(clss, usrnm, fmt)
 
#define mDefSimpleTranslatorSelector(clss)
 
#define mDefSimpleTranslatorioContextWithExtra(clss, stdtyp, extra)
 
#define mDefSimpleTranslatorioContext(clss, stdtyp)   mDefSimpleTranslatorioContextWithExtra(clss,stdtyp,)
 
#define mDefSimpleTranslators(clss, usrnm, fmt, stdtyp)
 
#define mDefSimpleTranslatorsWithCtioExtra(clss, usrnm, fmt, stdtyp, extra)
 
#define mDefSimpleTranslatorsWithSelKey(clss, usrnm, fmt, stdtyp, selky)
 
#define mIOObjContext(trgrp)   trgrp##TranslatorGroup::ioContext()
 
#define mTranslGroupName(trgrp)   trgrp##TranslatorGroup::sGroupName()
 
#define mTranslTemplInstance(trgrp, tr)
 
#define mTranslCreate(trgrp, tr)   (trgrp##Translator*)trgrp##TranslatorGroup::theInst().make(tr)
 
#define mTranslKey(trgrp, tr)   tr##trgrp##Translator::translKey()
 
#define mMkCtxtIOObj(trgrp)   new CtxtIOObj(trgrp##TranslatorGroup::ioContext())
 
#define mSelHist(trgrp)   trgrp##TranslatorGroup::theInst().selHist()
 

Functions

int defaultSelector (const char *, const char *)
 

Macro Definition Documentation

#define defineTranslator (   spec,
  clss,
  usrnm 
)
Value:
spec##clss##Translator* spec##clss##Translator::getInstance() \
{ return new spec##clss##Translator(#clss,usrnm); } \
const char* spec##clss##Translator::translKey() { return usrnm; } \
void spec##clss##Translator::initClass() \
mImplTranslatorInitClass( spec, clss, usrnm )
#define mImplTranslatorInitClass(spec, clss, usrnm)
Definition: transl.h:174
I/O Interpreter class for a certain object type.
Definition: transl.h:123
static void initClass()

In the source file of a Translator class.

#define defineTranslatorGroup (   clss,
  groupname 
)
Value:
FixedString clss##TranslatorGroup::sGroupName() \
{ return groupname; } \
TranslatorGroup& clss##TranslatorGroup::theInst() \
OD::String that holds an existing text string.
Definition: fixedstring.h:29
#define mImplTranslatorGroupTheInst(clss)
Definition: transl.h:180

In the source file of a TranslatorGroup class.

#define isTranslator (   spec,
  clss 
)    isTranslatorBody( spec, clss );
#define isTranslatorBody (   spec,
  clss 
)
Value:
public: \
Translator* getNew() const \
{ \
Translator* trans = new spec##clss##Translator(typeName().buf(), \
userName().buf()); \
trans->setGroup( group_ ); return trans; \
} \
static spec##clss##Translator* getInstance(); \
static const char* translKey(); \
static void initClass()
I/O Interpreter class for a certain object type.
Definition: transl.h:123
static void initClass()

In the class definition of a Translator class.

#define isTranslatorGroup (   clss)
Value:
clss##TranslatorGroup::theInst().translationApplication() ) \
Group of Translators. Has a static factory.
Definition: transl.h:56
#define mTextTranslationClass(clss, application)
Definition: uistring.h:28
#define isTranslatorGroupBody(clss)
In the class definition of a TranslatorGroup class.
Definition: transl.h:189
#define isTranslatorGroupBody (   clss)
Value:
protected: \
~clss##TranslatorGroup() {} \
public: \
static int selector(const char*); \
static void initClass() { theInst(); } \
static const IOObjContext& ioContext(); \
static FixedString sGroupName(); \
static uiString sTypeName(int num=1); \
virtual FixedString groupName() const { return sGroupName(); } \
virtual uiString typeName(int num=1) const \
{ return sTypeName(num); } \
virtual const IOObjContext& ioCtxt() const { return ioContext(); } \
virtual int objSelector( const char* s ) const { return selector(s); } \
static TranslatorGroup& theInst()
OD::String that holds an existing text string.
Definition: fixedstring.h:29
Definition: uistring.h:89
Group of Translators. Has a static factory.
Definition: transl.h:56
static void initClass()
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62

In the class definition of a TranslatorGroup class.

#define isTranslatorGroupWithInst (   clss)
Value:
#define mImplTranslatorGroupTheInst(clss)
Definition: transl.h:180
#define isTranslatorGroupBody(clss)
In the class definition of a TranslatorGroup class.
Definition: transl.h:189
#define mDeclEmptyTranslatorBundle (   mod,
  clss,
  fmt,
  defext 
)
Value:
mExpClass(mod) clss##TranslatorGroup : public TranslatorGroup \
{ isTranslatorGroup(clss) \
mDefEmptyTranslatorGroupConstructor(clss) \
const char* defExtension() const { return defext; } \
}; \
\
mExpClass(mod) clss##Translator : public Translator \
{ public: \
mDefEmptyTranslatorBaseConstructor(clss) \
}; \
\
mExpClass(mod) fmt##clss##Translator : public clss##Translator \
{ isTranslator(fmt,clss) \
mDefEmptyTranslatorConstructor(fmt,clss) \
};
#define mExpClass(module)
Definition: commondefs.h:160

Convenient when the entire Translator concept is not interesting 4 u. Use this in your header file to comply with the concept, so you can make use of OpendTect object selection, retrieval etc.

#define mDefEmptyTranslatorBaseConstructor (   clss)
Value:
clss##Translator( const char* nm, const char* unm ) \
: Translator(nm,unm) {}
I/O Interpreter class for a certain object type.
Definition: transl.h:123

Convenience when the Translator base class is not interesting 4 u. Defines a simple empty Translator class body

#define mDefEmptyTranslatorConstructor (   spec,
  clss 
)
Value:
spec##clss##Translator( const char* nm, const char* unm ) \
: clss##Translator(nm,unm) {}
I/O Interpreter class for a certain object type.
Definition: transl.h:123

Convenience when the Translator is not interesting 4 u. Defines a simple empty Translator subclass body

#define mDefEmptyTranslatorGroupConstructor (   clss)
Value:
clss##TranslatorGroup() \
: TranslatorGroup(#clss) {}
Group of Translators. Has a static factory.
Definition: transl.h:56

Convenience when the TranslatorGroup is not interesting 4 u. Defines a simple empty TranslatorGroup class body

#define mDefSimpleTranslatorInstances (   clss,
  usrnm,
  fmt 
)
Value:
defineTranslatorGroup(clss,usrnm) \
uiString clss##TranslatorGroup::sTypeName(int) { return toUiString(usrnm); } \
defineTranslator(fmt,clss,#fmt)
Export_Basic uiString toUiString(ViewStyle)
#define defineTranslator(spec, clss, usrnm)
In the source file of a Translator class.
Definition: transl.h:245
#define defineTranslatorGroup(clss, groupname)
In the source file of a TranslatorGroup class.
Definition: transl.h:238

Definitions for .cc file: Convenience when the entire Translator concept is not interesting This one can be convenient when a group has only one Translator

#define mDefSimpleTranslatorioContext (   clss,
  stdtyp 
)    mDefSimpleTranslatorioContextWithExtra(clss,stdtyp,)

Definitions for .cc file: Defines the function providing the IOObj context, no extras

#define mDefSimpleTranslatorioContextWithExtra (   clss,
  stdtyp,
  extra 
)
Value:
const IOObjContext& clss##TranslatorGroup::ioContext() \
{ \
mDefineStaticLocalObject( PtrMan<IOObjContext>, ctxt, = nullptr ); \
if ( !ctxt ) \
{ \
ctxt = new IOObjContext( nullptr ); \
ctxt->stdseltype_ = IOObjContext::stdtyp; \
extra; \
} \
ctxt->trgroup_ = &theInst(); \
return *ctxt; \
}
Definition: ptrman.h:79
Holds the context for selecting and/or creating IOObjs.
Definition: ctxtioobj.h:62

Definitions for .cc file: Defines the function providing the IOObj context This particular macro allows extension, setting extra members

#define mDefSimpleTranslators (   clss,
  usrnm,
  fmt,
  stdtyp 
)
Value:
#define mDefSimpleTranslatorSelector(clss)
Definition: transl.h:301
#define mDefSimpleTranslatorioContext(clss, stdtyp)
Definition: transl.h:324
#define mDefSimpleTranslatorInstances(clss, usrnm, fmt)
Definition: transl.h:294

Definitions for .cc file: Defines all necessary functions to implement This is the 'basic' one

#define mDefSimpleTranslatorSelector (   clss)
Value:
int clss##TranslatorGroup::selector( const char* s ) \
{ return defaultSelector(clss##TranslatorGroup::sGroupName(),s); }
int defaultSelector(const char *, const char *)

Definitions for .cc file: This particular macro defines a simple object selection definition

#define mDefSimpleTranslatorsWithCtioExtra (   clss,
  usrnm,
  fmt,
  stdtyp,
  extra 
)
Value:
#define mDefSimpleTranslatorioContextWithExtra(clss, stdtyp, extra)
Definition: transl.h:308
#define mDefSimpleTranslatorSelector(clss)
Definition: transl.h:301
#define mDefSimpleTranslatorInstances(clss, usrnm, fmt)
Definition: transl.h:294

Definitions for .cc file: Defines all necessary functions to implement This one allows adding code to set IOObjContext members

#define mDefSimpleTranslatorsWithSelKey (   clss,
  usrnm,
  fmt,
  stdtyp,
  selky 
)
Value:
mDefSimpleTranslatorsWithCtioExtra(clss,usrnm,fmt,stdtyp, \
ctxt->selkey_ = selky)
#define mDefSimpleTranslatorsWithCtioExtra(clss, usrnm, fmt, stdtyp, extra)
Definition: transl.h:338

Definitions for .cc file: Defines all necessary functions to implement This one sets the selkey Therefore it's the one you want to use if you have your own data sub-dir.

#define mDGBKey   "dGB"
#define mdTectKey   "dTect"
#define mImplTranslatorGroupTheInst (   clss)
Value:
{ \
mDefineStaticLocalObject(RefMan<TranslatorGroup>, inst, \
return *inst; \
}
Group of Translators. Has a static factory.
Definition: transl.h:56
static TranslatorGroup & addGroup(TranslatorGroup *)
Definition: ptrman.h:168
#define mImplTranslatorInitClass (   spec,
  clss,
  usrnm 
)
Value:
{ \
spec##clss##Translator* tr = new spec##clss##Translator( #spec, usrnm ); \
clss##TranslatorGroup::theInst().add( tr ); \
}
I/O Interpreter class for a certain object type.
Definition: transl.h:123
#define mIOObjContext (   trgrp)    trgrp##TranslatorGroup::ioContext()
#define mIsTranslatorWithInitClass (   spec,
  clss,
  usrnm 
)
Value:
isTranslatorBody(spec, clss) \
mImplTranslatorInitClass(spec, clss, usrnm )
#define isTranslatorBody(spec, clss)
In the class definition of a Translator class.
Definition: transl.h:217
#define mImplTranslatorInitClass(spec, clss, usrnm)
Definition: transl.h:174
#define mMkCtxtIOObj (   trgrp)    new CtxtIOObj(trgrp##TranslatorGroup::ioContext())
#define mObjSelMatch   2
#define mObjSelRelated   1
#define mObjSelUnrelated   0
#define mSelHist (   trgrp)    trgrp##TranslatorGroup::theInst().selHist()
#define mTranslCreate (   trgrp,
  tr 
)    (trgrp##Translator*)trgrp##TranslatorGroup::theInst().make(tr)
#define mTranslGroupName (   trgrp)    trgrp##TranslatorGroup::sGroupName()
#define mTranslKey (   trgrp,
  tr 
)    tr##trgrp##Translator::translKey()
#define mTranslTemplInstance (   trgrp,
  tr 
)
Value:
(*trgrp##TranslatorGroup::theInst() \
.getTemplate(tr##trgrp##Translator::translKey(),true))

Function Documentation

int defaultSelector ( const char *  ,
const char *   
)

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