StringSet.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
// Copyright (c) 1994 James Clark
// See the file COPYING for copying permission.
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef StringSet_INCLUDED
#define StringSet_INCLUDED 1
#include "StringC.h"
#include "Hash.h"
#include "Boolean.h"
#include "OwnerTable.h"
#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif
class StringSetKey {
public:
static inline const StringC &key(const StringC &str) { return str; }
};
class StringSet {
public:
StringSet();
Boolean add(const StringC &); // return 1 if already there
void swap(StringSet &);
void clear();
private:
StringSet(const StringSet &); // undefined
void operator=(const StringSet &); // undefined
OwnerTable<StringC, StringC, Hash, StringSetKey> table_;
};
inline
void StringSet::clear()
{
table_.clear();
}
#ifdef SP_NAMESPACE
}
#endif
#endif /* not StringSet_INCLUDED */