Show
Ignore:
Timestamp:
08/26/10 20:21:08 (21 months ago)
Author:
Antti-Juhani Kaijanaho <antti-juhani@…>
Children:
6c86e7ccc32f1c99d204262844a52b1b06359145
Parents:
7ccc366e52cc1e51e123b39fccaf56267361ca58
git-committer:
Antti-Juhani Kaijanaho <antti-juhani@…> (08/26/10 20:21:08)
Message:

Add support for paginating thread and article lists.

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tlate/thread_value.hh

    r868b365 r43f5212  
    11/*  This file is part of Alue, the multiprotocol Internet discussion daemon 
    22 
    3     Copyright © 2009 Antti-Juhani Kaijanaho 
     3    Copyright © 2009, 2010 Antti-Juhani Kaijanaho 
    44 
    55    Alue is free software: you can redistribute it and/or modify it 
     
    2626#include "../db/threaded.hh" 
    2727 
    28 #include <list> 
     28#include <vector> 
    2929 
    3030namespace db { class user; } 
     
    3434        class thread_value : public sequential_value 
    3535        { 
    36                 typedef std::list<db::thread_node::const_ptr> tl; 
    37                 typedef std::list<db::thread_node::ptr> tlnc; 
     36                typedef std::vector<db::thread_node::const_ptr> tl; 
    3837                tl tnl; 
    3938                boost::shared_ptr<const db::user> u; 
     
    6968 
    7069        public: 
     70                typedef boost::shared_ptr<thread_value> ptr; 
     71                typedef boost::shared_ptr<const thread_value> const_ptr; 
     72 
    7173                const_iterator begin() const { return new vit(tnl.begin(), u); } 
    7274                const_iterator end() const   { return new vit(tnl.end(),   u); } 
     
    7476                thread_value(db::thread_node::const_ptr tn, 
    7577                             boost::shared_ptr<const db::user> u); 
     78                void slice_window(size_t start, size_t length); 
     79                size_t size() const { return tnl.size(); } 
    7680        }; 
    7781}