95 return (strcmp(n1.
name, n2.
name) == 0);
100 return out << n.
name;
158 return &mem[
set[pnum]];
164 return &mem[
set[pkey]];
200 return set.key(pnum);
208 return result == 0 ?
DataKey() : *hashtab.
get(nam);
214 return set.number(pkey);
224 assert(hashtab.
get(nam) != 0);
234 return set.has(pnum);
238 bool has(
const char* str)
const 241 return hashtab.
has(nam);
247 return set.has(pkey);
255 void add(
const char* str);
273 void remove(
int pnum)
279 void remove(
const char* str);
282 void remove(
const DataKey keys[],
int n);
285 void remove(
const int nums[],
int n);
288 void remove(
int dstat[]);
299 void reMax(
int newmax = 0);
371 #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()
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.
NameSet & operator=(const NameSet &rhs)
assignment operator.
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.