Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::Collection< TYPE > Class Template Reference

Utility template class to handle collections that can be safely copied and shared. More...

`#include <Collection.h>`

Inheritance diagram for Lucene::Collection< TYPE >:

## Public Types

typedef Collection< TYPE > | this_type
typedef boost::shared_ptr< this_type > | shared_ptr
typedef std::vector< TYPE > | collection_type
typedef collection_type::iterator | iterator
typedef collection_type::const_iterator | const_iterator
typedef TYPE | value_type

## Public Member Functions

virtual | ~Collection ()
void | reset ()
void | resize (int32_t size)
int32_t | size () const
bool | empty () const
void | clear ()
iterator | begin ()
iterator | end ()
const_iterator | begin () const
const_iterator | end () const
void | add (const TYPE &type)
void | add (int32_t pos, const TYPE &type)
template<class ITER>
void | addAll (ITER first, ITER last)
template<class ITER>
void | insert (ITER pos, const TYPE &type)
template<class ITER>
ITER | remove (ITER pos)
template<class ITER>
ITER | remove (ITER first, ITER last)
void | remove (const TYPE &type)
template<class PRED>
void | remove_if (PRED comp)
TYPE | removeFirst ()
TYPE | removeLast ()
iterator | find (const TYPE &type)
template<class PRED>
iterator | find_if (PRED comp)
bool | contains (const TYPE &type) const
template<class PRED>
bool | contains_if (PRED comp) const
bool | equals (const this_type &other) const
template<class PRED>
bool | equals (const this_type &other, PRED comp) const
int32_t | hashCode ()
void | swap (this_type &other)
TYPE & | operator[] (int32_t pos)
const TYPE & | operator[] (int32_t pos) const
| operator bool () const
bool | operator! () const
bool | operator== (const this_type &other)
bool | operator!= (const this_type &other)
collection_type * | get ()
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock.
virtual LuceneSignalPtr | getSignal ()
| Return this object signal.
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout.
virtual void | unlock ()
| Unlock this object.
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread.
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout.
virtual void | notifyAll ()
| Notify all threads waiting for signal.

## Static Public Member Functions

static this_type | newInstance (int32_t size=0)
template<class ITER>
static this_type | newInstance (ITER first, ITER last)

## Protected Attributes

boost::shared_ptr< collection_type > | container
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Detailed Description

template<class TYPE>
class Lucene::Collection< TYPE >

Utility template class to handle collections that can be safely copied and shared.

## Member Typedef Documentation

## ◆ collection_type

template<class TYPE>

typedef std::vector<TYPE> Lucene::Collection< TYPE >::collection_type

## ◆ const_iterator

template<class TYPE>

typedef collection_type::const_iterator Lucene::Collection< TYPE >::const_iterator

## ◆ iterator

template<class TYPE>

typedef collection_type::iterator Lucene::Collection< TYPE >::iterator

## ◆ shared_ptr

template<class TYPE>

typedef boost::shared_ptr<this_type> Lucene::Collection< TYPE >::shared_ptr

## ◆ this_type

template<class TYPE>

typedef Collection<TYPE> Lucene::Collection< TYPE >::this_type

## ◆ value_type

template<class TYPE>

typedef TYPE Lucene::Collection< TYPE >::value_type

## Constructor & Destructor Documentation

## ◆ ~Collection()

template<class TYPE>

virtual Lucene::Collection< TYPE >::~Collection | ( |  | ) |

inline virtual

## Member Function Documentation

## ◆ add() [1/2]

template<class TYPE>

void Lucene::Collection< TYPE >::add | ( | const TYPE & | type | ) |

inline

References container.

Referenced by Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), Lucene::newCollection(), and Lucene::newCollection().

## ◆ add() [2/2]

template<class TYPE>

void Lucene::Collection< TYPE >::add | ( | int32_t | pos,
|  | const TYPE & | type )

inline

References container.

## ◆ addAll()

template<class TYPE>
template<class ITER>

void Lucene::Collection< TYPE >::addAll | ( | ITER | first,
|  | ITER | last )

inline

References container.

## ◆ begin() [1/2]

template<class TYPE>

iterator Lucene::Collection< TYPE >::begin | ( |  | ) |

inline

References container.

## ◆ begin() [2/2]

template<class TYPE>

const_iterator Lucene::Collection< TYPE >::begin | ( |  | ) | const

inline

References container.

## ◆ clear()

template<class TYPE>

void Lucene::Collection< TYPE >::clear | ( |  | ) |

inline

References container.

## ◆ contains()

template<class TYPE>

bool Lucene::Collection< TYPE >::contains | ( | const TYPE & | type | ) | const

inline

References container.

## ◆ contains_if()

template<class TYPE>
template<class PRED>

bool Lucene::Collection< TYPE >::contains_if | ( | PRED | comp | ) | const

inline

References container.

## ◆ empty()

template<class TYPE>

bool Lucene::Collection< TYPE >::empty | ( |  | ) | const

inline

References container.

## ◆ end() [1/2]

template<class TYPE>

iterator Lucene::Collection< TYPE >::end | ( |  | ) |

inline

References container.

## ◆ end() [2/2]

template<class TYPE>

const_iterator Lucene::Collection< TYPE >::end | ( |  | ) | const

inline

References container.

## ◆ equals() [1/2]

template<class TYPE>

bool Lucene::Collection< TYPE >::equals | ( | const this_type & | other | ) | const

inline

References equals().

Referenced by equals().

## ◆ equals() [2/2]

template<class TYPE>
template<class PRED>

bool Lucene::Collection< TYPE >::equals | ( | const this_type & | other,
|  | PRED | comp ) const

inline

References container.

## ◆ find()

template<class TYPE>

iterator Lucene::Collection< TYPE >::find | ( | const TYPE & | type | ) |

inline

References container.

## ◆ find_if()

template<class TYPE>
template<class PRED>

iterator Lucene::Collection< TYPE >::find_if | ( | PRED | comp | ) |

inline

References container.

## ◆ get()

template<class TYPE>

collection_type * Lucene::Collection< TYPE >::get | ( |  | ) |

inline

References container.

## ◆ hashCode()

template<class TYPE>

int32_t Lucene::Collection< TYPE >::hashCode | ( |  | ) |

inline

References container.

## ◆ insert()

template<class TYPE>
template<class ITER>

void Lucene::Collection< TYPE >::insert | ( | ITER | pos,
|  | const TYPE & | type )

inline

References container.

## ◆ newInstance() [1/2]

template<class TYPE>

this_type Lucene::Collection< TYPE >::newInstance | ( | int32_t | size = 0 | ) |

inline static

References container, Lucene::newInstance(), and size().

Referenced by Lucene::newCollection(), and Lucene::NumericComparator< TYPE >::NumericComparator().

## ◆ newInstance() [2/2]

template<class TYPE>
template<class ITER>

this_type Lucene::Collection< TYPE >::newInstance | ( | ITER | first,
|  | ITER | last )

inline static

References container, and Lucene::newInstance().

## ◆ operator bool()

template<class TYPE>

Lucene::Collection< TYPE >::operator bool | ( |  | ) | const

inline

References container.

## ◆ operator!()

template<class TYPE>

bool Lucene::Collection< TYPE >::operator! | ( |  | ) | const

inline

References container.

## ◆ operator!=()

template<class TYPE>

bool Lucene::Collection< TYPE >::operator!= | ( | const this_type & | other | ) |

inline

References container.

## ◆ operator==()

template<class TYPE>

bool Lucene::Collection< TYPE >::operator== | ( | const this_type & | other | ) |

inline

References container.

## ◆ operator[]() [1/2]

template<class TYPE>

TYPE & Lucene::Collection< TYPE >::operator[] | ( | int32_t | pos | ) |

inline

References container.

## ◆ operator[]() [2/2]

template<class TYPE>

const TYPE & Lucene::Collection< TYPE >::operator[] | ( | int32_t | pos | ) | const

inline

References container.

## ◆ remove() [1/3]

template<class TYPE>

void Lucene::Collection< TYPE >::remove | ( | const TYPE & | type | ) |

inline

References container.

## ◆ remove() [2/3]

template<class TYPE>
template<class ITER>

ITER Lucene::Collection< TYPE >::remove | ( | ITER | first,
|  | ITER | last )

inline

References container.

## ◆ remove() [3/3]

template<class TYPE>
template<class ITER>

ITER Lucene::Collection< TYPE >::remove | ( | ITER | pos | ) |

inline

References container.

## ◆ remove_if()

template<class TYPE>
template<class PRED>

void Lucene::Collection< TYPE >::remove_if | ( | PRED | comp | ) |

inline

References container.

## ◆ removeFirst()

template<class TYPE>

TYPE Lucene::Collection< TYPE >::removeFirst | ( |  | ) |

inline

References container.

## ◆ removeLast()

template<class TYPE>

TYPE Lucene::Collection< TYPE >::removeLast | ( |  | ) |

inline

References container.

## ◆ reset()

template<class TYPE>

void Lucene::Collection< TYPE >::reset | ( |  | ) |

inline

References resize().

## ◆ resize()

template<class TYPE>

void Lucene::Collection< TYPE >::resize | ( | int32_t | size | ) |

inline

References container, and size().

Referenced by reset().

## ◆ size()

template<class TYPE>

int32_t Lucene::Collection< TYPE >::size | ( |  | ) | const

inline

References container.

Referenced by newInstance(), and resize().

## ◆ swap()

template<class TYPE>

void Lucene::Collection< TYPE >::swap | ( | this_type & | other | ) |

inline

References container.

## Field Documentation

## ◆ container

template<class TYPE>

boost::shared_ptr<collection_type> Lucene::Collection< TYPE >::container

protected

Referenced by add(), add(), addAll(), begin(), begin(), clear(), contains(), contains_if(), empty(), end(), end(), equals(), find(), find_if(), get(), hashCode(), insert(), newInstance(), newInstance(), operator bool(), operator!(), operator!=(), operator==(), operator[](), operator[](), remove(), remove(), remove(), remove_if(), removeFirst(), removeLast(), resize(), size(), and swap().

The documentation for this class was generated from the following file:

- Collection.h

clucene.sourceforge.net