16 template <
class TYPE,
class LESS = std::less<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 bool add(
const TYPE& type) {
78 return setContainer->insert(type).second;
83 setContainer->insert(first, last);
86 bool remove(
const TYPE& type) {
87 return (setContainer->erase(type) > 0);
90 iterator
find(
const TYPE& type) {
91 return setContainer->find(type);
95 return (setContainer->find(type) != setContainer->end());
98 bool equals(
const this_type& other)
const {
99 return equals(other, std::equal_to<TYPE>());
102 template <
class PRED>
103 bool equals(
const this_type& other, PRED comp)
const {
104 if (setContainer->size() != other.
setContainer->size()) {
107 return std::equal(setContainer->begin(), setContainer->end(), other.
setContainer->begin(), comp);
114 operator bool()
const {
115 return setContainer.get() != NULL;
boost::shared_ptr< set_type > setContainer
Definition: Set.h:29
bool contains(const TYPE &type) const
Definition: Set.h:94
bool add(const TYPE &type)
Definition: Set.h:77
bool empty() const
Definition: Set.h:53
std::set< TYPE, LESS > set_type
Definition: Set.h:20
Base class for all Lucene synchronised classes.
Definition: LuceneSync.h:15
const_iterator begin() const
Definition: Set.h:69
iterator end()
Definition: Set.h:65
void clear()
Definition: Set.h:57
void swap(this_type &other)
Definition: Set.h:110
bool equals(const this_type &other) const
Definition: Set.h:98
bool operator!() const
Definition: Set.h:118
set_type::const_iterator const_iterator
Definition: Set.h:22
bool operator!=(const this_type &other)
Definition: Set.h:126
bool operator==(const this_type &other)
Definition: Set.h:122
static this_type newInstance(ITER first, ITER last)
Definition: Set.h:39
Definition: AbstractAllTermDocs.h:12
int32_t size() const
Definition: Set.h:49
TYPE value_type
Definition: Set.h:23
void addAll(ITER first, ITER last)
Definition: Set.h:82
void reset()
Definition: Set.h:45
const_iterator end() const
Definition: Set.h:73
set_type::iterator iterator
Definition: Set.h:21
virtual ~Set()
Definition: Set.h:25
Utility template class to handle set based collections that can be safely copied and shared...
Definition: Set.h:17
Set< TYPE, LESS > this_type
Definition: Set.h:19
iterator begin()
Definition: Set.h:61
static this_type newInstance()
Definition: Set.h:32
iterator find(const TYPE &type)
Definition: Set.h:90
bool equals(const this_type &other, PRED comp) const
Definition: Set.h:103