2012-06-02 21:36:20 +05:30
|
|
|
#ifndef TIMELINE_H
|
|
|
|
#define TIMELINE_H
|
|
|
|
|
2012-08-07 09:31:15 +02:00
|
|
|
#include "transport/threadpool.h"
|
2012-06-02 21:36:20 +05:30
|
|
|
#include "../libtwitcurl/twitcurl.h"
|
|
|
|
#include "../TwitterResponseParser.h"
|
|
|
|
#include "transport/logging.h"
|
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
2012-06-10 21:39:29 +05:30
|
|
|
#include <boost/function.hpp>
|
2012-06-02 21:36:20 +05:30
|
|
|
|
|
|
|
using namespace Transport;
|
|
|
|
|
|
|
|
class TimelineRequest : public Thread
|
|
|
|
{
|
2012-06-03 15:01:50 +05:30
|
|
|
twitCurl *twitObj;
|
2012-06-02 21:36:20 +05:30
|
|
|
std::string user;
|
2012-06-06 13:42:06 +05:30
|
|
|
std::string userRequested;
|
2012-06-02 21:36:20 +05:30
|
|
|
std::string replyMsg;
|
2012-06-07 01:37:01 +05:30
|
|
|
std::string since_id;
|
|
|
|
bool success;
|
2012-08-12 20:11:06 +05:30
|
|
|
boost::function< void (std::string&, std::string&, std::vector<Status> &, Error&) > callBack;
|
2012-06-10 21:39:29 +05:30
|
|
|
std::vector<Status> tweets;
|
2012-06-02 21:36:20 +05:30
|
|
|
|
|
|
|
public:
|
2012-06-10 21:39:29 +05:30
|
|
|
TimelineRequest(twitCurl *obj, const std::string &_user, const std::string &_user2, const std::string &_since_id,
|
2012-08-12 20:11:06 +05:30
|
|
|
boost::function< void (std::string&, std::string&, std::vector<Status> &, Error&) > cb) {
|
2012-06-03 15:01:50 +05:30
|
|
|
twitObj = obj->clone();
|
2012-06-02 21:36:20 +05:30
|
|
|
user = _user;
|
2012-06-06 13:42:06 +05:30
|
|
|
userRequested = _user2;
|
2012-06-07 01:37:01 +05:30
|
|
|
since_id = _since_id;
|
2012-06-10 21:39:29 +05:30
|
|
|
callBack = cb;
|
2012-06-02 21:36:20 +05:30
|
|
|
}
|
|
|
|
|
2012-06-03 15:01:50 +05:30
|
|
|
~TimelineRequest() {
|
|
|
|
//std::cerr << "*****Timeline request: DESTROYING twitObj****" << std::endl;
|
|
|
|
delete twitObj;
|
|
|
|
}
|
|
|
|
|
2012-06-02 21:36:20 +05:30
|
|
|
void run();
|
|
|
|
void finalize();
|
|
|
|
};
|
|
|
|
#endif
|