spectrum2/backends/twitter/Requests/StatusUpdateRequest.h

41 lines
862 B
C
Raw Normal View History

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