Logo Search packages:      
Sourcecode: pan version File versions

pan::AdaptableSet< X, StrictWeakOrdering > Class Template Reference

#include <adaptable-set.h>

List of all members.

Detailed Description

template<class X, class StrictWeakOrdering>
class pan::AdaptableSet< X, StrictWeakOrdering >

A std::set-like container that allows items to be reordered..

The intent is for newly-added elements to be inserted into the proper ordered place but to let callers rearrange elements at will. The subset of unmoved elements will remain ordered.

This is used by the task queue so that users can rearrange tasks, but newly-added tasks will be added in a best-fit manner.

Definition at line 40 of file adaptable-set.h.

Public Types

typedef items_t::const_iterator const_iterator
typedef std::vector< X > items_t
typedef items_t::iterator iterator

Public Member Functions

void add (const std::vector< X > &)
int add (X &)
void add_bottom (const std::vector< X > &)
void add_listener (Listener *l)
void add_top (const std::vector< X > &)
iterator begin ()
const_iterator begin () const
bool empty () const
iterator end ()
const_iterator end () const
int index_of (const X &x) const
void move (int new_index, int old_index)
void move_bottom (int index)
void move_down (int index)
void move_top (int index)
void move_up (int index)
const X & operator[] (int i) const
void remove (int index)
void remove_listener (Listener *l)
int size () const

Protected Member Functions

virtual void fire_item_moved (X &, int index, int old_index)
virtual void fire_item_removed (X &, int index)
virtual void fire_items_added (items_t &, int index)

Protected Attributes

items_t _items

Private Types

typedef std::set< Listener * > listeners_t

Private Member Functions

void remove_from_unmoved (const X &x)

Private Attributes

const StrictWeakOrdering _comp
listeners_t _listeners
items_t _unmoved


struct  Listener

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

Generated by  Doxygen 1.6.0   Back to index