OpendTect-6_4  6.4
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
EnumDef Class Reference

Holds data pertinent to a certain enum. It does not know the enum values themselves, but treat them as integers. More...

Inheritance diagram for EnumDef:
[legend]

Public Member Functions

 EnumDef ()
 
 EnumDef (const char *nm, const char *s[], short nrs=0)
 
bool isValidKey (const char *) const
 
int indexOf (const char *s) const
 
int indexOf (int enumval) const
 
int getEnumValForIndex (int) const
 
const char * getKeyForIndex (int i) const
 
uiString getUiStringForIndex (int i) const
 
void setUiStringForIndex (int, const uiString &)
 
const BufferStringSetkeys () const
 
const uiStringSetstrings () const
 
const char * getIconFileForIndex (int idx) const
 
void setIconFileForIndex (int idx, const char *)
 
int size () const
 
void remove (const char *key)
 
void add (const char *key, const uiString &, int enumval, const char *iconfile)
 
bool isValidName (const char *key) const
 
const char * convert (int idx) const
 
int convert (const char *txt) const
 
- Public Member Functions inherited from NamedObject
 NamedObject (const char *nm=0)
 
 NamedObject (const NamedObject *linkedto)
 
 NamedObject (const NamedObject &)
 
virtual ~NamedObject ()
 
void setLinkedTo (NamedObject *)
 
bool operator== (const NamedObject &oth) const
 
virtual const OD::Stringname () const
 
virtual const OD::StringannotName () const
 
virtual void setName (const char *)
 
void setCleanName (const char *)
 cleans string first More...
 
void deleteNotify (const CallBack &)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false)
 
bool attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false)
 
void detachCB (NotifierAccess &, const CallBack &)
 
void detachCB (NotifierAccess *notif, const CallBack &cb)
 
bool isNotifierAttached (NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 

Protected Member Functions

void fillUiStrings ()
 
- Protected Member Functions inherited from CallBacker
void detachAllNotifiers ()
 Call from the destructor of your inherited object. More...
 

Protected Attributes

uiStringSet uistrings_
 
BufferStringSet keys_
 
TypeSet< int > enums_
 
BufferStringSet iconfiles_
 
- Protected Attributes inherited from NamedObject
BufferStringname_
 
NamedObjectlinkedto_
 
CallBackSetdelnotify_
 

Detailed Description

Holds data pertinent to a certain enum. It does not know the enum values themselves, but treat them as integers.

In most cases, the inherited EnumDefImpl<ENUM> is used, but a stand-alone EnumDef can be used if one wants to use combinations of enums that are not available as EnumDefImpl.

A stand-alone EnumDef can be created as follows to create a combo box with all enums in Stats::Type without the average.

EnumDef def = Stats::TypeDef();
def.remove( def.getKey(Stats::Average) );
new uiComboBox( this, def );

Constructor & Destructor Documentation

EnumDef::EnumDef ( )
EnumDef::EnumDef ( const char *  nm,
const char *  s[],
short  nrs = 0 
)

Member Function Documentation

void EnumDef::add ( const char *  key,
const uiString ,
int  enumval,
const char *  iconfile 
)
const char* EnumDef::convert ( int  idx) const
inline
int EnumDef::convert ( const char *  txt) const
inline
void EnumDef::fillUiStrings ( )
protected
int EnumDef::getEnumValForIndex ( int  ) const
const char* EnumDef::getIconFileForIndex ( int  idx) const
const char* EnumDef::getKeyForIndex ( int  i) const
uiString EnumDef::getUiStringForIndex ( int  i) const
int EnumDef::indexOf ( const char *  s) const
int EnumDef::indexOf ( int  enumval) const
bool EnumDef::isValidKey ( const char *  ) const
bool EnumDef::isValidName ( const char *  key) const
inline
const BufferStringSet& EnumDef::keys ( ) const
inline
void EnumDef::remove ( const char *  key)
void EnumDef::setIconFileForIndex ( int  idx,
const char *   
)
void EnumDef::setUiStringForIndex ( int  ,
const uiString  
)
int EnumDef::size ( ) const
const uiStringSet& EnumDef::strings ( ) const
inline

Member Data Documentation

TypeSet<int> EnumDef::enums_
protected
BufferStringSet EnumDef::iconfiles_
protected
BufferStringSet EnumDef::keys_
protected
uiStringSet EnumDef::uistrings_
protected

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