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

Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes

pan::DataImpl Class Reference
[Backend Implementation]

#include <data-impl.h>

Inheritance diagram for pan::DataImpl:
Inheritance graph
Collaboration diagram for pan::DataImpl:
Collaboration graph

List of all members.


struct  ArticleNode
struct  GroupHeaders
class  MyTree
struct  NodeWeakOrdering
struct  ReadGroup
struct  Server
struct  XOverEntry

Public Types

typedef std::set< const Article * > unique_articles_t

Public Member Functions

virtual void add_groups (const Quark &server, const NewGroup *new_groups, size_t group_count)
void add_listener (Listener *l)
virtual Quark add_new_server ()
virtual void add_profile (const std::string &profile_name, const Profile &profile)
virtual void add_profile (const std::string &profile_name, const Profile &profile)=0
virtual void add_score (const StringView &section_wildmat, int score_value, bool score_assign_flag, int lifespan_days, bool all_items_must_be_true, const Scorefile::AddItem *items, size_t item_count, bool do_rescore)
virtual void comment_out_scorefile_line (const StringView &filename, size_t begin_line, size_t end_line, bool do_rescore)
 DataImpl (bool unit_test=false, int cache_megs=10, DataIO *source=new DataIO())
virtual void delete_articles (const unique_articles_t &)
virtual void delete_profile (const std::string &profile_name)
virtual void delete_profile (const std::string &profile_name)=0
virtual void delete_server (const Quark &server)
virtual void get_article_scores (const Quark &newsgroup, const Article &article, Scorefile::items_t &setme) const
virtual ArticleCacheget_cache ()
virtual const ArticleCacheget_cache () const
virtual void get_group_counts (const Quark &group, unsigned long &setme_unread, unsigned long &setme_total) const
virtual const std::string & get_group_description (const Quark &group) const
virtual char get_group_permission (const Quark &group) const
virtual void get_other_groups (std::vector< Quark > &) const
virtual bool get_profile (const std::string &profile_name, Profile &setme) const =0
virtual bool get_profile (const std::string &profile_name, Profile &setme) const
virtual std::set< std::string > get_profile_names () const =0
virtual std::set< std::string > get_profile_names () const
virtual bool get_server_addr (const Quark &server, std::string &setme_host, int &setme_port) const
virtual std::string get_server_address (const Quark &servername) const
virtual int get_server_article_expiration_age (const Quark &server) const
virtual bool get_server_auth (const Quark &server, std::string &setme_username, std::string &setme_password) const
virtual int get_server_limits (const Quark &server) const
virtual int get_server_rank (const Quark &server) const
virtual quarks_t get_servers () const
virtual void get_subscribed_groups (std::vector< Quark > &) const
virtual unsigned long get_xover_high (const Quark &group, const Quark &server) const
virtual void group_clear_articles (const Quark &group)
virtual ArticleTreegroup_get_articles (const Quark &group, const ShowType show_type=SHOW_ARTICLES, const FilterInfo *criteria=0) const
virtual void group_get_servers (const Quark &group, quarks_t &) const
virtual bool has_from_header (const StringView &from) const
virtual bool has_from_header (const StringView &from) const =0
virtual bool has_profiles () const
virtual bool has_profiles () const =0
virtual bool is_read (const Article *) const
virtual void load_tasks (std::vector< Task * > &setme)
virtual void load_tasks (std::vector< Task * > &setme UNUSED)
virtual void mark_group_read (const Quark &group)
virtual void mark_read (const Article &article, bool mark_read)
virtual void mark_read (const Article **articles, unsigned long article_count, bool mark_read=true)
void remove_listener (Listener *l)
virtual void rescore ()
void rescore_articles (const Quark &group, const quarks_t mids)
virtual void save_state ()
virtual void save_tasks (const std::vector< Task * > &saveme UNUSED)
virtual void save_tasks (const std::vector< Task * > &saveme)
virtual void server_get_groups (const Quark &server, quarks_t &) const
virtual void set_group_subscribed (const Quark &group, bool sub)
virtual void set_server_addr (const Quark &server, const StringView &host, const int port)
virtual void set_server_article_expiration_age (const Quark &server, int days)
virtual void set_server_auth (const Quark &server, const StringView &username, const StringView &password)
virtual void set_server_limits (const Quark &server, int max_connections)
virtual void set_server_rank (const Quark &server, int rank)
virtual void set_xover_high (const Quark &group, const Quark &server, const unsigned long high)
virtual void set_xover_low (const Quark &group, const Quark &server, const unsigned long low)
virtual const Articlexover_add (const Quark &server, const Quark &group, const StringView &subject, const StringView &author, const time_t date, const StringView &message_id, const StringView &references, const unsigned long byte_count, const unsigned long line_count, const StringView &xref)
virtual void xover_flush (const Quark &group)
virtual void xover_ref (const Quark &group)
virtual void xover_unref (const Quark &group)

Public Attributes

const ArticleFilter _article_filter

Protected Member Functions

void fire_group_counts (const Quark &, unsigned long unread, unsigned long total)
void fire_group_read (const Quark &)
void fire_group_subscribe (const Quark &, bool)
void fire_grouplist_rebuilt ()

Private Types

typedef sorted_vector< Quark,
typedef std::vector< const
ArticleNode * > 
typedef std::map< Quark,
std::string > 
typedef Loki::AssocVector
< Quark, GroupHeaders * > 
typedef sorted_vector< Quark,
true > 
typedef std::map< Quark,
ArticleNode * > 
typedef std::vector
< ArticleNode * > 
typedef Loki::AssocVector
< Quark, ReadGroup
typedef Loki::AssocVector
< Quark, Server
typedef sorted_vector< Quark,
true > 
typedef Loki::AssocVector
< Quark, XOverEntry

Private Member Functions

void add_articles_to_tree (MyTree *, const quarks_t &mids)
void ensure_descriptions_are_loaded () const
ReadGroupfind_read_group (const Quark &g)
const ReadGroupfind_read_group (const Quark &g) const
const ReadGroup::Serverfind_read_group_server (const Quark &g, const Quark &s) const
ReadGroup::Serverfind_read_group_server (const Quark &g, const Quark &s)
const Serverfind_server (const Quark &server) const
Serverfind_server (const Quark &server)
void free_group_headers_memory (const Quark &group)
virtual void get_article_references (const Quark &group, const Article *, std::string &setme) const
GroupHeadersget_group_headers (const Quark &group)
const GroupHeadersget_group_headers (const Quark &group) const
std::string get_newsrc_filename (const Quark &server) const
bool is_read (const Xref &) const
void load_article (const Quark &g, Article *article, const StringView &references)
void load_group_descriptions (const DataIO &) const
void load_group_permissions (const DataIO &)
void load_group_xovers (const DataIO &)
void load_headers (const DataIO &, const Quark &group)
void load_newsrc (const Quark &server, LineReader *, alpha_groups_t &, alpha_groups_t &)
void load_newsrc_files (const DataIO &)
void load_part (const Quark &g, const Quark &mid, int number, const StringView &part_mid, unsigned long lines, unsigned long bytes)
void load_server_properties (const DataIO &)
void on_articles_added (const Quark &group, const quarks_t &mids)
void on_articles_changed (const Quark &group, const quarks_t &mids, bool do_refilter)
void on_articles_removed (const quarks_t &mids) const
void rebuild_backend ()
void ref_group (const Quark &group)
void remove_articles_from_tree (MyTree *, const quarks_t &mids) const
void save_group_descriptions (DataIO &) const
void save_group_permissions (DataIO &) const
void save_group_xovers (DataIO &) const
bool save_headers (DataIO &, const Quark &group, const std::vector< Article * > &, unsigned long &, unsigned long &) const
void save_headers (DataIO &, const Quark &group) const
void save_newsrc_files (DataIO &) const
void save_server_properties (DataIO &) const
void unref_group (const Quark &group)
void xover_clear_workarea (const Quark &group)
XOverEntryxover_get_workarea (const Quark &group)

Static Private Member Functions

static ArticleNodefind_ancestor (ArticleNode *node, const Quark &ancestor_mid)
static const ArticleNodefind_closest_ancestor (const ArticleNode *node, const unique_sorted_quarks_t &mid_pool)
static ArticleNodefind_closest_ancestor (ArticleNode *node, const unique_sorted_quarks_t &mid_pool)
static void find_nodes (const quarks_t &mids, nodes_t &nodes, nodes_v &setme)
static void find_nodes (const quarks_t &mids, const nodes_t &nodes, const_nodes_v &setme)

Private Attributes

ArticleCache _cache
Quark _cached_xover_group
descriptions_t _descriptions
bool _descriptions_loaded
group_to_headers_t _group_to_headers
groups_t _moderated
groups_t _nopost
read_groups_t _read_groups
Scorefile _scorefile
servers_t _servers
alpha_groups_t _subscribed
std::set< MyTree * > _trees
const bool _unit_test
alpha_groups_t _unsubscribed
xovers_t _xovers

Detailed Description

File-based implementation of the `Data' backend interface.

Most of the files are stored in $PAN_HOME, which defaults to $HOME/.pan2 if the PAN_HOME environmental variable isn't set.

Definition at line 56 of file data-impl.h.

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

Generated by  Doxygen 1.6.0   Back to index