spectrum2/backends/twitter/Requests/FetchFriends.h

42 lines
937 B
C
Raw Normal View History

#ifndef FRIENDS_H
#define FRIENDS_H
2012-08-07 09:31:15 +02:00
#include "transport/threadpool.h"
#include "../libtwitcurl/twitcurl.h"
#include "../TwitterResponseParser.h"
#include "transport/logging.h"
#include <string>
2012-06-10 21:39:29 +05:30
#include <boost/signals.hpp>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <iostream>
using namespace Transport;
class FetchFriends : public Thread
{
2012-06-03 15:01:50 +05:30
twitCurl *twitObj;
std::string user;
std::string replyMsg;
2012-06-10 21:39:29 +05:30
std::vector<User> friends;
std::vector<std::string> friendAvatars;
2012-06-10 21:39:29 +05:30
bool success;
2012-08-12 20:11:06 +05:30
boost::function< void (std::string, std::vector<User> &, std::vector<std::string> &, Error) > callBack;
public:
2012-06-10 21:39:29 +05:30
FetchFriends(twitCurl *obj, const std::string &_user,
2012-08-12 20:11:06 +05:30
boost::function< void (std::string, std::vector<User> &, std::vector<std::string> &, Error) > cb) {
2012-06-03 15:01:50 +05:30
twitObj = obj->clone();
user = _user;
2012-06-10 21:39:29 +05:30
callBack = cb;
}
2012-06-03 15:01:50 +05:30
~FetchFriends() {
delete twitObj;
}
void run();
void finalize();
};
#endif