ATLAS Offline Software
Loading...
Searching...
No Matches
CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload Struct Reference

unique_ptr deletion class for a payload object. More...

#include <ConcurrentRangeMap.h>

Collaboration diagram for CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload:

Public Member Functions

 DeletePayload (delete_function *delfcn)
 Initialize with an explicit deletion function.
template<class U>
 DeletePayload (const std::default_delete< U > &)
void operator() (const T *p) const
 Delete a pointer.

Static Public Member Functions

template<class U>
static void delfcn (const T *p)
 Allow initializing a payload_unique_ptr from a std::unique_ptr.

Public Attributes

delete_functionm_delete
 The deletion function.

Detailed Description

template<class RANGE, class KEY, class T, class COMPARE, template< class > class UPDATER>
struct CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload

unique_ptr deletion class for a payload object.

We can't use the unique_ptr default because we want to allow instantiating with a void.

Definition at line 236 of file ConcurrentRangeMap.h.

Constructor & Destructor Documentation

◆ DeletePayload() [1/2]

template<class RANGE, class KEY, class T, class COMPARE, template< class > class UPDATER>
CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload::DeletePayload ( delete_function * delfcn)
inline

Initialize with an explicit deletion function.

Definition at line 239 of file ConcurrentRangeMap.h.

240 : m_delete (delfcn)
241 {
242 }
delete_function * m_delete
The deletion function.
static void delfcn(const T *p)
Allow initializing a payload_unique_ptr from a std::unique_ptr.

◆ DeletePayload() [2/2]

template<class RANGE, class KEY, class T, class COMPARE, template< class > class UPDATER>
template<class U>
CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload::DeletePayload ( const std::default_delete< U > & )
inline

Definition at line 251 of file ConcurrentRangeMap.h.

252 {
254 }

Member Function Documentation

◆ delfcn()

template<class RANGE, class KEY, class T, class COMPARE, template< class > class UPDATER>
template<class U>
void CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload::delfcn ( const T * p)
inlinestatic

Allow initializing a payload_unique_ptr from a std::unique_ptr.

Definition at line 246 of file ConcurrentRangeMap.h.

247 {
248 delete reinterpret_cast<const U*>(p);
249 }
Map from range to payload object, allowing concurrent, lockless reads.

◆ operator()()

template<class RANGE, class KEY, class T, class COMPARE, template< class > class UPDATER>
void CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload::operator() ( const T * p) const
inline

Delete a pointer.

Definition at line 257 of file ConcurrentRangeMap.h.

258 {
259 m_delete (p);
260 }

Member Data Documentation

◆ m_delete

template<class RANGE, class KEY, class T, class COMPARE, template< class > class UPDATER>
delete_function* CxxUtils::ConcurrentRangeMap< RANGE, KEY, T, COMPARE, UPDATER >::DeletePayload::m_delete

The deletion function.

Definition at line 263 of file ConcurrentRangeMap.h.


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