rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
arc.hpp
1#pragma once
2
3//
4// Copyright (c) 2019-2022 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include <boost/intrusive_ptr.hpp>
10#include <boost/smart_ptr/intrusive_ref_counter.hpp>
11#include "rotor/export.h"
12
13namespace rotor {
14
15#ifdef ROTOR_REFCOUNT_THREADUNSAFE
17using counter_policy_t = boost::thread_unsafe_counter;
18#else
20using counter_policy_t = boost::thread_safe_counter;
21#endif
22
24template <typename T> using arc_base_t = boost::intrusive_ref_counter<T, counter_policy_t>;
25
27template <typename T> using intrusive_ptr_t = boost::intrusive_ptr<T>;
28
29} // namespace rotor
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
boost::thread_safe_counter counter_policy_t
thread-safe intrusive pointer policy
Definition arc.hpp:20
boost::intrusive_ref_counter< T, counter_policy_t > arc_base_t
base class to inject ref-counter with the specified policy
Definition arc.hpp:24
boost::intrusive_ptr< T > intrusive_ptr_t
alias for intrusive pointer
Definition arc.hpp:27