OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::RcEnable< TypeT, RcT > Class Template Reference

A class template that enables reference counting for a given type. More...

#include <make_rc.hpp>

Inheritance diagram for openvpn::RcEnable< TypeT, RcT >:
[legend]
Collaboration diagram for openvpn::RcEnable< TypeT, RcT >:
[legend]

Public Types

using Ptr = RCPtr< RcEnable >
 Alias for the pointer type used by the reference counting class.
 
- Public Types inherited from openvpn::RC< RCImpl >
typedef RCPtr< RCPtr
 

Static Public Member Functions

template<typename... ArgsT>
static Ptr Create (ArgsT &&...args)
 Creates a new instance of RcEnable with the given arguments.
 
- Static Public Member Functions inherited from openvpn::RC< RCImpl >
static constexpr bool is_thread_safe ()
 Delegates call to RCImpl and returns the result.
 

Private Member Functions

template<typename... ArgsT>
 RcEnable (ArgsT &&...args)
 Private constructor for RcEnable.
 

Additional Inherited Members

- Public Member Functions inherited from openvpn::RC< RCImpl >
 RC () noexcept=default
 
virtual ~RC ()=default
 
 RC (const RC &)=delete
 
RCoperator= (const RC &)=delete
 
olong use_count () const noexcept
 Delegates call to RCImpl and returns the result.
 

Detailed Description

template<typename TypeT, typename RcT = RC<thread_unsafe_refcount>>
class openvpn::RcEnable< TypeT, RcT >

A class template that enables reference counting for a given type.

This class inherits from both the TypeT and RcT (Reference Counting) classes. It provides a convenient way to create reference-counted objects of TypeT.

Template Parameters
TypeTThe base type to be reference-counted.
RcTThe reference counting class, defaulting to RC<thread_unsafe_refcount>.

Definition at line 28 of file make_rc.hpp.

Member Typedef Documentation

◆ Ptr

template<typename TypeT , typename RcT = RC<thread_unsafe_refcount>>
using openvpn::RcEnable< TypeT, RcT >::Ptr = RCPtr<RcEnable>

Alias for the pointer type used by the reference counting class.

Definition at line 31 of file make_rc.hpp.

Constructor & Destructor Documentation

◆ RcEnable()

template<typename TypeT , typename RcT = RC<thread_unsafe_refcount>>
template<typename... ArgsT>
openvpn::RcEnable< TypeT, RcT >::RcEnable ( ArgsT &&...  args)
inlineprivate

Private constructor for RcEnable.

This constructor is used to create a new instance of RcEnable with the provided arguments. It initializes the base classes TypeT and RcT with the forwarded arguments.

Template Parameters
ArgsTThe parameter pack types for the arguments to be forwarded to the base class constructors.
Parameters
argsThe arguments to be forwarded to the base class constructors.
Note
This constructor is private and should not be called directly. Use the Create() function to create instances of RcEnable.

Definition at line 61 of file make_rc.hpp.

Member Function Documentation

◆ Create()

template<typename TypeT , typename RcT = RC<thread_unsafe_refcount>>
template<typename... ArgsT>
static Ptr openvpn::RcEnable< TypeT, RcT >::Create ( ArgsT &&...  args)
inlinestatic

Creates a new instance of RcEnable with the given arguments.

This function creates a new RcEnable object using the provided arguments and returns a smart pointer (Ptr) to the created object.

Template Parameters
ArgsTThe parameter pack types for the arguments to be forwarded to the RcEnable constructor.
Parameters
argsThe arguments to be forwarded to the RcEnable constructor.
Returns
A smart pointer (Ptr) to the newly created RcEnable object with intrusive ref count.

Definition at line 43 of file make_rc.hpp.

Here is the caller graph for this function:

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