Logo Search packages:      
Sourcecode: pan version File versions  Download package

pan::Queue Class Reference

#include <queue.h>

Inheritance diagram for pan::Queue:

pan::NNTP::Source pan::NNTP_Pool::Listener pan::AdaptableSet< X, StrictWeakOrdering >::Listener

List of all members.

Detailed Description

Queues up tasks to be processed by NNTP objects as news server connections become available.

Definition at line 57 of file queue.h.

Public Types

enum  AddMode { AGE, TOP, BOTTOM }
typedef std::vector< Task * > tasks_t

Public Member Functions

void add_listener (Listener *l)
void add_task (Task *, AddMode=AGE)
void add_tasks (const tasks_t &, AddMode=AGE)
virtual void check_in (NNTP *, bool is_ok)
bool contains (const Quark &message_id) const
void get_all_task_states (task_states_t &setme)
void get_connection_counts (int &setme_active, int &setme_idle, int &setme_connecting) const
void get_full_connection_counts (std::vector< ServerConnectionCounts > &setme) const
double get_speed_KiBps () const
void get_task_counts (int &active, int &total)
void get_task_speed_KiBps (const Task *, double &setme_KiBps, int &setme_connections) const
bool is_online () const
void move_bottom (const tasks_t &)
void move_down (const tasks_t &)
void move_top (const tasks_t &)
void move_up (const tasks_t &)
const Taskoperator[] (size_t i) const
Taskoperator[] (size_t i)
 Queue (ServerInfo &, TaskArchive &, Socket::Creator *, bool online)
void remove_latest_task ()
void remove_listener (Listener *l)
void remove_task (Task *)
void remove_tasks (const tasks_t &)
void restart_tasks (const tasks_t &)
void set_online (bool online)
void stop_tasks (const tasks_t &)
void upkeep ()

Protected Types

typedef std::map< NNTP *, Task * > nntp_to_task_t

Protected Member Functions

bool find_best_server (const Task::State::unique_servers_t &servers, Quark &setme)
Taskfind_first_task_needing_server (const Quark &server)
virtual void fire_task_moved (Task *&, int index, int old_index)
virtual void fire_task_removed (Task *&, int index)
virtual void fire_tasks_added (int index, int count)
void give_task_a_connection (Task *, NNTP *)
void process_task (Task *)
bool task_is_active (const Task *) const

Protected Attributes

bool _is_online
nntp_to_task_t _nntp_to_task
std::set< Task * > _removing
std::set< Task * > _stopped

Private Types

typedef std::set< Listener * > listeners_t
typedef listeners_t::iterator lit
typedef Loki::AssocVector
< Quark, NNTP_Pool * > 
typedef AdaptableSet< Task
*, TaskWeakOrdering

Private Member Functions

void fire_connection_count_changed (int count)
void fire_if_counts_have_changed ()
void fire_online_changed (bool online)
void fire_queue_error (const StringView &message)
void fire_size_changed (int active, int total)
void fire_task_active_changed (Task *, bool)
NNTP_Poolget_pool (const Quark &server)
virtual void on_pool_error (const Quark &server, const StringView &message)
virtual void on_pool_has_nntp_available (const Quark &server)
virtual void on_set_item_moved (AdaptableSet &, X &, int index, int old_index)=0
virtual void on_set_item_moved (TaskSet &, Task *&, int index, int old_index)
virtual void on_set_item_removed (AdaptableSet &, X &, int index)=0
virtual void on_set_item_removed (TaskSet &, Task *&, int index)
virtual void on_set_items_added (AdaptableSet &, items_t &, int index)=0
virtual void on_set_items_added (TaskSet &, TaskSet::items_t &, int index)
void request_connections (const quarks_t &servers)

Private Attributes

time_t _last_time_saved
listeners_t _listeners
quarks_t _mids
bool _needs_saving
pools_t _pools
TaskSet _tasks


struct  Listener
struct  ServerConnectionCounts
struct  task_states_t

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

Generated by  Doxygen 1.6.0   Back to index