10 #include <boost/unordered_set.hpp> 16 template <
class TYPE,
class HASH = boost::hash<TYPE>,
class EQUAL = std::equal_to<TYPE> >
20 typedef boost::unordered_set<TYPE, HASH, EQUAL>
set_type;
41 instance.
setContainer = Lucene::newInstance<set_type>(first, last);
50 return (int32_t)setContainer->size();
54 return setContainer->empty();
58 setContainer->clear();
62 return setContainer->begin();
66 return setContainer->end();
70 return setContainer->begin();
73 const_iterator
end()
const {
74 return setContainer->end();
77 operator bool()
const {
78 return setContainer.get() != NULL;
86 setContainer = other.setContainer;
90 bool add(
const TYPE& type) {
91 return setContainer->insert(type).second;
96 setContainer->insert(first, last);
99 bool remove(
const TYPE& type) {
100 return (setContainer->erase(type) > 0);
103 iterator
find(
const TYPE& type) {
104 return setContainer->find(type);
108 return (setContainer->find(type) != setContainer->end());
set_type::iterator iterator
Definition: HashSet.h:21
const_iterator begin() const
Definition: HashSet.h:69
iterator end()
Definition: HashSet.h:65
bool operator!() const
Definition: HashSet.h:81
bool add(const TYPE &type)
Definition: HashSet.h:90
HashSet< TYPE, HASH, EQUAL > this_type
Definition: HashSet.h:19
Base class for all Lucene synchronised classes.
Definition: LuceneSync.h:15
bool contains(const TYPE &type) const
Definition: HashSet.h:107
iterator find(const TYPE &type)
Definition: HashSet.h:103
void addAll(ITER first, ITER last)
Definition: HashSet.h:95
static this_type newInstance(ITER first, ITER last)
Definition: HashSet.h:39
Utility template class to handle hash set collections that can be safely copied and shared...
Definition: HashSet.h:17
const_iterator end() const
Definition: HashSet.h:73
Definition: AbstractAllTermDocs.h:12
bool empty() const
Definition: HashSet.h:53
void clear()
Definition: HashSet.h:57
set_type::const_iterator const_iterator
Definition: HashSet.h:22
boost::shared_ptr< set_type > setContainer
Definition: HashSet.h:29
virtual ~HashSet()
Definition: HashSet.h:25
TYPE value_type
Definition: HashSet.h:23
iterator begin()
Definition: HashSet.h:61
boost::unordered_set< TYPE, HASH, EQUAL > set_type
Definition: HashSet.h:20
set_type & operator=(const set_type &other)
Definition: HashSet.h:85
void reset()
Definition: HashSet.h:45
int32_t size() const
Definition: HashSet.h:49
static this_type newInstance()
Definition: HashSet.h:32