File: TimelineRequest.h

package info (click to toggle)
spectrum2 2.2.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,548 kB
  • sloc: cpp: 32,594; python: 1,751; javascript: 273; makefile: 34; sql: 31; xml: 10
file content (43 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef TIMELINE_H
#define TIMELINE_H

#include "transport/ThreadPool.h"
#include "../libtwitcurl/twitcurl.h"
#include "../TwitterResponseParser.h"
#include "transport/Logging.h"
#include <string>
#include <iostream>
#include <boost/function.hpp>

using namespace Transport;

class TimelineRequest : public Thread
{
	twitCurl *twitObj;
	std::string user;
	std::string userRequested;
	std::string replyMsg;
	std::string since_id;
	bool success;
	boost::function< void (std::string&, std::string&, std::vector<Status> &, Error&) > callBack;
	std::vector<Status> tweets;

	public:
	TimelineRequest(twitCurl *obj, const std::string &_user, const std::string &_user2, const std::string &_since_id,
					boost::function< void (std::string&, std::string&, std::vector<Status> &, Error&) > cb) {
		twitObj = obj->clone();
		user = _user;
		userRequested = _user2;
		since_id = _since_id;
		callBack = cb;
	}

	~TimelineRequest() {
		//std::cerr << "*****Timeline request: DESTROYING twitObj****" << std::endl;
		delete twitObj;
	}

	void run();
	void finalize();
};
#endif