libmoost
/home/mhx/git/github/libmoost/include/moost/murcl/request.hpp
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00036 #ifndef FM_LAST_MOOST_MURCL_REQUEST_HPP__
00037 #define FM_LAST_MOOST_MURCL_REQUEST_HPP__
00038 
00039 #include <stdexcept>
00040 #include <iostream>
00041 #include <boost/bind.hpp>
00042 
00043 #include <curl/curl.h>
00044 
00045 #include "easy.hpp"
00046 #include "response.hpp"
00047 
00048 namespace moost { namespace murcl {
00049 
00050 class request
00051 {
00052 public:
00059    request(easy::ptr peasy)
00060       : peasy_(peasy)
00061    {
00062    }
00063 
00070    void perform(response & resp)
00071    {
00072       peasy_->set_option<easyopt::writedata>(resp());
00073       peasy_->set_option<easyopt::writecb>(response::callback);
00074       peasy_->perform();
00075    }
00076 
00077 private:
00078    easy::ptr peasy_;
00079 };
00080 
00081 }}
00082 
00083 #endif // FM_LAST_MOOST_MURCL_REQUEST_HPP__