CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CurlInterface.h
Go to the documentation of this file.
1 // $Id: CurlInterface.h,v 1.4 2011/11/16 14:32:22 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_CurlInterface_h
5 #define EventFilter_StorageManager_CurlInterface_h
6 
7 #include "boost/shared_ptr.hpp"
8 
9 #include <curl/curl.h>
10 #include <openssl/crypto.h>
11 #include <pthread.h>
12 #include <string>
13 #include <vector>
14 
15 
16 namespace stor {
17 
27  {
28 
29  public:
30 
31  typedef std::vector<char> Content;
32 
34 
38  static boost::shared_ptr<CurlInterface> getInterface();
39 
47  CURLcode getContent(const std::string& url, const std::string& user, Content& content);
48 
55  CURLcode postBinaryMessage(const std::string& url, void* buf, size_t size, Content& content);
56 
57 
58  private:
59 
60  CurlInterface();
61 
62  CURLcode do_curl(CURL*, const std::string& url, Content& content);
63  static size_t writeToString(char* data, size_t size, size_t nmemb, Content* buffer);
64  static void sslLockingFunction(int mode, int n, const char* file, int line);
65  static unsigned long sslIdFunction();
66 
67  static boost::shared_ptr<CurlInterface> interface_;
68  static pthread_mutex_t* mutexes_;
69  };
70 
71  typedef boost::shared_ptr<CurlInterface> CurlInterfacePtr;
72 
73 } // namespace stor
74 
75 #endif // EventFilter_StorageManager_CurlInterface_h
76 
77 
static void sslLockingFunction(int mode, int n, const char *file, int line)
static unsigned long sslIdFunction()
static boost::shared_ptr< CurlInterface > getInterface()
static boost::shared_ptr< CurlInterface > interface_
Definition: CurlInterface.h:67
CURLcode do_curl(CURL *, const std::string &url, Content &content)
CURLcode getContent(const std::string &url, const std::string &user, Content &content)
boost::shared_ptr< CurlInterface > CurlInterfacePtr
Definition: CurlInterface.h:71
static size_t writeToString(char *data, size_t size, size_t nmemb, Content *buffer)
static pthread_mutex_t * mutexes_
Definition: CurlInterface.h:68
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
CURLcode postBinaryMessage(const std::string &url, void *buf, size_t size, Content &content)
tuple size
Write out results.
std::vector< char > Content
Definition: CurlInterface.h:31