| http://www.coin3d.org/ http://www.kongsberg.com/kogt/

Public Member Functions | List of all members
dimeDict Class Reference

The dimeDict class is internal / private. More...

`#include <dime/util/Dict.h>`

## Public Member Functions

| dimeDict (const int entries=17989)
| ~dimeDict ()
void | clear ()
bool | enter (const char *const key, char *&ptr, void *value)
const char * | enter (const char *const key, void *value)
const char * | find (const char *const key) const
bool | find (const char *const key, void *&value) const
bool | remove (const char *const key)
void | dump (void)
void | print_info ()

## Detailed Description

The dimeDict class is internal / private.

It offers quick (hashing) lookup for strings.

## Constructor & Destructor Documentation

## ◆ dimeDict()

dimeDict::dimeDict | ( | const int | entries = `17989` | ) |

Constructor. Creates entries buckets.

## ◆ ~dimeDict()

dimeDict::~dimeDict | ( |  | ) |

Destructor.

References clear().

## Member Function Documentation

## ◆ clear()

void dimeDict::clear | ( |  | ) |

Clear all entries in the dictionary.

Referenced by ~dimeDict().

## ◆ enter() [1/2]

bool dimeDict::enter | ( | const char *const | key,
|  | char *& | ptr,
|  | void * | value
| ) |  |

Inserts a new string key in the dictionary. This function returns true if the string was not already in the dictionary, false otherwise. The string pointer is returned in ptr.

Referenced by dimeModel::addBlock(), dimeModel::addLayer(), and dimeModel::addReference().

## ◆ enter() [2/2]

const char * dimeDict::enter | ( | const char *const | key,
|  | void * | value
| ) |  |

Insert a new string key in the dictionary, and associates a id (= value) to it. Returns a pointer to the string. If the string is already in the dictionary, the old id is replaced with value;

## ◆ find() [1/2]

const char * dimeDict::find | ( | const char *const | key | ) | const

Finds if key is in the dictionary. Returns the string pointer if found, NULL otherwise.

Referenced by dimeModel::addLayer(), dimeModel::findBlock(), dimeModel::findReference(), dimeModel::findRefStringPtr(), and dimeModel::getLayer().

## ◆ find() [2/2]

bool dimeDict::find | ( | const char *const | key,
|  | void *& | value
| ) |  | const

Finds if key is in the dictionary. Returns true if found.

## ◆ remove()

bool dimeDict::remove | ( | const char *const | key | ) |

Remove key from the dictionary.

Referenced by dimeModel::removeReference().

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

- Dict.h
- Dict.cpp

Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.