95 return (strcmp(n1.
name, n2.
name) == 0);
100 return out << n.
name;
164 return &mem[
set[pnum]];
170 return &mem[
set[pkey]];
206 return set.key(pnum);
214 return result == 0 ?
DataKey() : *hashtab.
get(nam);
220 return set.number(pkey);
230 assert(hashtab.
get(nam) != 0);
240 return set.has(pnum);
244 bool has(
const char* str)
const 247 return hashtab.
has(nam);
253 return set.has(pkey);
261 void add(
const char* str);
279 void remove(
int pnum)
285 void remove(
const char* str);
288 void remove(
const DataKey keys[],
int n);
291 void remove(
const int nums[],
int n);
294 void remove(
int dstat[]);
305 void reMax(
int newmax = 0);
377 #endif // _NAMESET_H_ int memSize() const
returns used length of string memory.
Generic hash table for data objects.
const char * name
pointer to the name string.
int num() const
returns nr. of names in NameSet.
Entry identifier class for items of a DataSet.
DataHashTable< Name, DataKey > hashtab
hashtable for names
void reMax(int newmax=0)
resets max() to newmax.
bool isConsistent() const
consistency check.
DataKey key(const char *str) const
returns DataKey of name str in NameSet.
Entry identifier class for items of a DataSet.Every item in a DataSet is assigned a DataKey by which ...
static const char deflt
default zero string.
int memmax
size of string memory
Handles of names in a NameSet.Class Name provides the handles (i.e., char*s) of names in a NameSet...
NameSet(int max=10000, int mmax=-1, Real fac=2, Real memFac=2)
default constructor.
Name(const char *str)
implictly constructs a Name out of a C style character string.
friend int operator==(const Name &n1, const Name &n2)
equality operator.
const char * operator[](int pnum) const
returns num 'th name of NameSet.
Name & operator=(const Name &old)
Name()
default constructor.
bool has(const char *str) const
does NameSet has a name str?
Name(const Name &str)
copy constructor.
int number(const char *str) const
returns number of name str in NameSet.
Real factor
memory extension factor for entries.
DataKey key(int pnum) const
returns DataKey of the pnum 'th name in NameSet.
const char * operator[](const DataKey &pkey) const
returns name for DataKey pkey of NameSet.
Generic hash table for data objects.Class DataHashTable provides a generic hash table for Data Object...
void add(const char *str)
void clear()
removes all names from NameSet.
Debugging, floating point type and parameter definitions.
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
Everything should be within this namespace.
int memused
size of used string memory
bool has(const DataKey &pkey) const
does NameSet has a name with DataKey pkey?
void memRemax(int newmax=0)
resets memMax() to newmax.
void memPack()
garbage collection.
Real memFactor
memory extension factor for names.
bool has(const HashItem &h) const
Is item h present in DataHashTable?
const Info * get(const HashItem &h) const
returns const pointer to Info of HashItem h or 0, if item is not found.
friend std::ostream & operator<<(std::ostream &out, const Name &n)
output operator.
int max() const
returns maximum nr. of names that fit into NameSet.
int size() const
returns maximum DataKey::idx used in NameSet.
int number(const DataKey &pkey) const
returns number of name with DataKey pkey in NameSet.
bool has(int pnum) const
does NameSet has a name with number pnum?
int memMax() const
returns maximum length of string memory.