FX::FXDict Class Reference

#include <FXDict.h>

Inheritance diagram for FX::FXDict:

Inheritance graph
[legend]

List of all members.


Detailed Description

The dictionary class maintains a fast-access hash table of entities indexed by a character string. It is typically used to map strings to pointers; however, overloading the createData() and deleteData() members allows any type of data to be indexed by strings.

Public Member Functions

 FXDict ()
 FXDict (const FXDict &orig)
FXDictoperator= (const FXDict &orig)
void size (FXint m)
FXint size () const
FXint no () const
void * insert (const FXchar *ky, const void *ptr, bool mrk=false)
void * replace (const FXchar *ky, const void *ptr, bool mrk=false)
void * remove (const FXchar *ky)
void * find (const FXchar *ky) const
bool empty (FXint pos) const
const FXchar * key (FXuint pos) const
void * data (FXuint pos) const
bool mark (FXuint pos) const
FXint first () const
FXint last () const
FXint next (FXint pos) const
FXint prev (FXint pos) const
void clear ()
virtual ~FXDict ()
virtual long onDefault (FXObject *, FXSelector, void *)
const FXchar * getClassName () const
bool isMemberOf (const FXMetaClass *metaclass) const
virtual long tryHandle (FXObject *sender, FXSelector sel, void *ptr)
virtual void save (FXStream &store) const
virtual void load (FXStream &store)
QTransString tr (const char *text, const char *hint=0)
virtual void * getPythonObject () const
virtual void decouplePythonObject () const

Protected Member Functions

virtual void * createData (const void *)
virtual void deleteData (void *)

Static Protected Member Functions

static FXint hash (const FXchar *str)

Protected Attributes

FXDictEntry * dict
FXint total
FXint number

Constructor & Destructor Documentation

FX::FXDict::FXDict (  ) 

Construct an empty dictionary.

FX::FXDict::FXDict ( const FXDict orig  ) 

Copy constructor; does bit-copy of void pointer data.

virtual FX::FXDict::~FXDict (  )  [virtual]

Destructor.


Member Function Documentation

virtual void* FX::FXDict::createData ( const void *   )  [protected, virtual]

Overload this function in a derived class to return the data pointer given an input pointer; the default implementation just returns the input pointer.

Reimplemented in FX::FXFileDict, FX::FXIconDict, FX::FXSettings, and FX::FXStringDict.

virtual void FX::FXDict::deleteData ( void *   )  [protected, virtual]

Overload this function in a derived class to delete the pointer previously returned by createData(); the default implementation does nothing.

Reimplemented in FX::FXFileDict, FX::FXIconDict, FX::FXSettings, and FX::FXStringDict.

FXDict& FX::FXDict::operator= ( const FXDict orig  ) 

Assignment operator.

void FX::FXDict::size ( FXint  m  ) 

Resize the table to the given size.

FXint FX::FXDict::size (  )  const [inline]

Return the size of the table, including the empty slots.

FXint FX::FXDict::no (  )  const [inline]

Return the total number of entries in the table.

void* FX::FXDict::insert ( const FXchar *  ky,
const void *  ptr,
bool  mrk = false 
)

Insert a new entry into the table given key and mark. If there is already an entry with that key, leave it unchanged, otherwise insert the new entry.

Referenced by FX::FXStringDict::insert(), and FX::FXIconDict::insert().

void* FX::FXDict::replace ( const FXchar *  ky,
const void *  ptr,
bool  mrk = false 
)

Replace data at key, if the entry's mark is less than or equal to the given mark. If there was no existing entry, a new entry is inserted with the given mark.

Referenced by FX::FXStringDict::replace().

void* FX::FXDict::remove ( const FXchar *  ky  ) 

void* FX::FXDict::find ( const FXchar *  ky  )  const

Find data pointer given key.

Reimplemented in FX::FXSettings, and FX::FXStringDict.

Referenced by FX::FXStringDict::find(), FX::FXSettings::find(), and FX::FXIconDict::find().

bool FX::FXDict::empty ( FXint  pos  )  const [inline]

Return true if slot is empty.

const FXchar* FX::FXDict::key ( FXuint  pos  )  const [inline]

Return key at position pos.

void* FX::FXDict::data ( FXuint  pos  )  const [inline]

return data pointer at position pos.

Reimplemented in FX::FXSettings, and FX::FXStringDict.

Referenced by FX::FXSettings::data().

bool FX::FXDict::mark ( FXuint  pos  )  const [inline]

Return mark flag of entry at position pos.

FXint FX::FXDict::first (  )  const

Return position of first filled slot, or >= total

FXint FX::FXDict::last (  )  const

Return position of last filled slot or -1

FXint FX::FXDict::next ( FXint  pos  )  const

Return position of next filled slot in hash table or a value greater than or equal to total if no filled slot was found

FXint FX::FXDict::prev ( FXint  pos  )  const

Return position of previous filled slot in hash table or a -1 if no filled slot was found

void FX::FXDict::clear (  ) 

Clear all entries.

Reimplemented in FX::FXSettings.

virtual long FX::FXObject::onDefault ( FXObject ,
FXSelector  ,
void *   
) [virtual, inherited]

Called for unhandled messages.

Reimplemented in FX::FXDelegator, FX::FXGLViewer, FX::FXMDIChild, and FX::FXMDIClient.

const FXchar* FX::FXObject::getClassName (  )  const [inherited]

Get class name of some object.

bool FX::FXObject::isMemberOf ( const FXMetaClass metaclass  )  const [inherited]

Check if object is member of metaclass.

virtual long FX::FXObject::tryHandle ( FXObject sender,
FXSelector  sel,
void *  ptr 
) [virtual, inherited]

Try handle message safely.

virtual void FX::FXObject::save ( FXStream store  )  const [virtual, inherited]

Save object to stream.

Reimplemented in FX::FX4Splitter, FX::FX7Segment, FX::FXAccelTable, FX::FXApp, FX::FXArrowButton, FX::FXBitmap, FX::FXBitmapFrame, FX::FXBitmapView, FX::FXCheckButton, FX::FXChoiceBox, FX::FXColorBar, FX::FXColorDialog, FX::FXColorRing, FX::FXColorSelector, FX::FXColorWell, FX::FXColorWheel, FX::FXComboBox, FX::FXCursor, FX::FXDial, FX::FXDirBox, FX::FXDirDialog, FX::FXDirList, FX::FXDirSelector, FX::FXDockBar, FX::FXDockHandler, FX::FXDockTitle, FX::FXDocument, FX::FXDragCorner, FX::FXDrawable, FX::FXDriveBox, FX::FXFileDialog, FX::FXFileDict, FX::FXFileList, FX::FXFileSelector, FX::FXFoldingItem, FX::FXFoldingList, FX::FXFont, FX::FXFontDialog, FX::FXFontSelector, FX::FXFrame, FX::FXGLCanvas, FX::FXGLCone, FX::FXGLContext, FX::FXGLCube, FX::FXGLCylinder, FX::FXGLGroup, FX::FXGLShape, FX::FXGLSphere, FX::FXGLTriangleMesh, FX::FXGLVertices, FX::FXGLViewer, FX::FXGLVisual, FX::FXGradientBar, FX::FXGroupBox, FX::FXHeaderItem, FX::FXHeader, FX::FXIconDict, FX::FXIconItem, FX::FXIconList, FX::FXIconSource, FX::FXId, FX::FXImage, FX::FXImageFrame, FX::FXImageView, FX::FXKnob, FX::FXLabel, FX::FXListItem, FX::FXList, FX::FXListBox, FX::FXMDIChild, FX::FXMDIClient, FX::FXMenuButton, FX::FXMenuCaption, FX::FXMenuCascade, FX::FXMenuCheck, FX::FXMenuCommand, FX::FXMenuRadio, FX::FXMenuSeparator, FX::FXMenuTitle, FX::FXOptionMenu, FX::FXPacker, FX::FXPrimaryButton, FX::FXPrintDialog, FX::FXProgressBar, FX::FXRadioButton, FX::FXRealSlider, FX::FXRealSpinner, FX::FXRecentFiles, FX::FXReplaceDialog, FX::FXRuler, FX::FXRulerView, FX::FXScrollBar, FX::FXSlider, FX::FXSpinner, FX::FXSplashWindow, FX::FXSplitter, FX::FXSpring, FX::FXStatusBar, FX::FXStatusLine, FX::FXSwitcher, FX::FXTabBar, FX::FXTableItem, FX::FXTable, FX::FXText, FX::FXTextField, FX::FXToggleButton, FX::FXToolBarGrip, FX::FXToolBarShell, FX::FXToolBarTab, FX::FXToolTip, FX::FXTopWindow, FX::FXTreeItem, FX::FXTreeList, FX::FXTreeListBox, FX::FXTriStateButton, FX::FXVisual, FX::FXWindow, and FX::FXWizard.

virtual void FX::FXObject::load ( FXStream store  )  [virtual, inherited]

Load object from stream.

Reimplemented in FX::FX4Splitter, FX::FX7Segment, FX::FXAccelTable, FX::FXApp, FX::FXArrowButton, FX::FXBitmap, FX::FXBitmapFrame, FX::FXBitmapView, FX::FXCheckButton, FX::FXChoiceBox, FX::FXColorBar, FX::FXColorDialog, FX::FXColorRing, FX::FXColorSelector, FX::FXColorWell, FX::FXColorWheel, FX::FXComboBox, FX::FXCursor, FX::FXDial, FX::FXDirBox, FX::FXDirDialog, FX::FXDirList, FX::FXDirSelector, FX::FXDockBar, FX::FXDockHandler, FX::FXDockTitle, FX::FXDocument, FX::FXDragCorner, FX::FXDrawable, FX::FXDriveBox, FX::FXFileDialog, FX::FXFileDict, FX::FXFileList, FX::FXFileSelector, FX::FXFoldingItem, FX::FXFoldingList, FX::FXFont, FX::FXFontDialog, FX::FXFontSelector, FX::FXFrame, FX::FXGLCanvas, FX::FXGLCone, FX::FXGLContext, FX::FXGLCube, FX::FXGLCylinder, FX::FXGLGroup, FX::FXGLShape, FX::FXGLSphere, FX::FXGLTriangleMesh, FX::FXGLVertices, FX::FXGLViewer, FX::FXGLVisual, FX::FXGradientBar, FX::FXGroupBox, FX::FXHeaderItem, FX::FXHeader, FX::FXIconDict, FX::FXIconItem, FX::FXIconList, FX::FXIconSource, FX::FXId, FX::FXImage, FX::FXImageFrame, FX::FXImageView, FX::FXKnob, FX::FXLabel, FX::FXListItem, FX::FXList, FX::FXListBox, FX::FXMDIChild, FX::FXMDIClient, FX::FXMenuButton, FX::FXMenuCaption, FX::FXMenuCascade, FX::FXMenuCheck, FX::FXMenuCommand, FX::FXMenuRadio, FX::FXMenuSeparator, FX::FXMenuTitle, FX::FXOptionMenu, FX::FXPacker, FX::FXPrimaryButton, FX::FXPrintDialog, FX::FXProgressBar, FX::FXRadioButton, FX::FXRealSlider, FX::FXRealSpinner, FX::FXRecentFiles, FX::FXReplaceDialog, FX::FXRuler, FX::FXRulerView, FX::FXScrollBar, FX::FXSlider, FX::FXSpinner, FX::FXSplashWindow, FX::FXSplitter, FX::FXSpring, FX::FXStatusBar, FX::FXStatusLine, FX::FXSwitcher, FX::FXTabBar, FX::FXTableItem, FX::FXTable, FX::FXText, FX::FXTextField, FX::FXToggleButton, FX::FXToolBarGrip, FX::FXToolBarShell, FX::FXToolBarTab, FX::FXToolTip, FX::FXTopWindow, FX::FXTreeItem, FX::FXTreeList, FX::FXTreeListBox, FX::FXTriStateButton, FX::FXVisual, FX::FXWindow, and FX::FXWizard.

QTransString FX::FXObject::tr ( const char *  text,
const char *  hint = 0 
) [inherited]

Returns a human translated version of the text to the locale language (warning: uses a virtual method call, so can't use before construction)

virtual void* FX::FXObject::getPythonObject (  )  const [inline, virtual, inherited]

Returns the python object representing this instance (if created in python).

virtual void FX::FXObject::decouplePythonObject (  )  const [inline, virtual, inherited]

Causes decoupling of python object from this object (deletes self).


The documentation for this class was generated from the following file:

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 21:57:45 2008 for TnFOX by doxygen v1.5.6