curl-cpp
static c++17 wrapper for curl with -fno-exceptions support
Public Member Functions | List of all members
curl::Share< void > Class Reference

#include <curl_share.hpp>

Inheritance diagram for curl::Share< void >:
Inheritance graph
Collaboration diagram for curl::Share< void >:
Collaboration graph

Public Member Functions

constexpr void enable_multithreaded_share () const noexcept
 
constexpr void disable_multithreaded_share () const noexcept
 
 Share_base (curl_t::Share_t &&share) noexcept
 
 Share_base (const Share_base &)=delete
 
 Share_base (Share_base &&other) noexcept
 
- Public Member Functions inherited from curl::Share_base
 Share_base (curl_t::Share_t &&share) noexcept
 
 Share_base (const Share_base &)=delete
 
 Share_base (Share_base &&other) noexcept
 
Share_baseoperator= (const Share_base &)=delete
 
Share_baseoperator= (Share_base &&other) noexcept
 
 operator bool () const noexcept
 
void add_lock (lock_function_t lock_func, unlock_function_t unlock_func, void *userptr) noexcept
 
auto enable_sharing (Options option) noexcept -> Ret_except< int, std::bad_alloc >
 
void disable_sharing (Options option) noexcept
 
void add_easy (Easy_ref_t &easy) noexcept
 
void remove_easy (Easy_ref_t &easy) noexcept
 

Additional Inherited Members

- Public Types inherited from curl::Share_base
enum  Options {
  none = CURL_LOCK_DATA_NONE, cookie = CURL_LOCK_DATA_COOKIE, Options::dns = CURL_LOCK_DATA_DNS, Options::ssl_session = CURL_LOCK_DATA_SSL_SESSION,
  Options::connection_cache = CURL_LOCK_DATA_CONNECT, Options::psl = CURL_LOCK_DATA_PSL
}
 
using lock_function_t = void(*)(CURL *handle, curl_lock_data data, curl_lock_access access, void *userptr)
 
using unlock_function_t = void(*)(CURL *handle, curl_lock_data data, void *userptr)
 
- Protected Attributes inherited from curl::Share_base
curl_t::Share_t curl_share
 

Detailed Description

Sepecialiation of Share that does no locking, thus is multithread unsafe.

This provides the same interface as any other Share<T>, so that your template can simply pass void to disable locking.

Definition at line 245 of file curl_share.hpp.

Member Function Documentation

◆ Share_base() [1/3]

curl::Share_base::Share_base
noexcept
Parameters
sharemust be != nullptr

After this ctor call, share.get() == nullptr, this class will take over the ownership.

Definition at line 15 of file curl_share.cc.

15  :
16  curl_share{std::move(share)}
17 {}

◆ Share_base() [2/3]

curl::Share_base::Share_base
delete

Since libcurl doesn't provide a dup function for curl_share, neither will Share_base.

◆ Share_base() [3/3]

curl::Share_base::Share_base
noexcept
Parameters
otherbool(other) can be false, but then this new instance of Share_base will be unusable.

Definition at line 19 of file curl_share.cc.

19  :
20  curl_share{std::move(other.curl_share)}
21 {}

The documentation for this class was generated from the following file: