struct lttng_notification_channel {
using uptr = std::unique_ptr<
lttng_notification_channel,
- lttng::details::create_unique_class<lttng_notification_channel,
+ lttng::memory::create_deleter_class<lttng_notification_channel,
lttng_notification_channel_destroy>::deleter>;
pthread_mutex_t lock;
struct lttng_notification {
using uptr = std::unique_ptr<
lttng_notification,
- lttng::details::create_unique_class<lttng_notification,
+ lttng::memory::create_deleter_class<lttng_notification,
lttng_notification_destroy>::deleter>;
struct lttng_trigger *trigger;
struct rotation_thread_job {
using uptr = std::unique_ptr<
rotation_thread_job,
- lttng::details::create_unique_class<rotation_thread_job, lttng::free>>;
+ lttng::memory::create_deleter_class<rotation_thread_job, lttng::free>::deleter>;
enum ls::rotation_thread_job_type type;
struct ltt_session *session;
using id_t = uint64_t;
using locked_ptr =
std::unique_ptr<ltt_session,
- lttng::details::create_unique_class<
+ lttng::memory::create_deleter_class<
ltt_session,
lttng::sessiond::details::locked_session_release>::deleter>;
using sptr = std::shared_ptr<ltt_session>;
public:
using locked_ptr =
std::unique_ptr<registry_session,
- lttng::details::create_unique_class<
+ lttng::memory::create_deleter_class<
registry_session,
details::locked_registry_session_release>::deleter>;
} while (ret != 0);
}
- std::unique_ptr<char, lttng::details::create_unique_class<char, lttng::free>>
+ std::unique_ptr<char, lttng::memory::create_deleter_class<char, lttng::free>::deleter>
stats_str;
if (!session_was_already_stopped) {
char *raw_stats_str = nullptr;
private:
std::size_t _sessions_count;
std::unique_ptr<lttng_session,
- lttng::details::create_unique_class<lttng_session, lttng::free>>
+ lttng::memory::create_deleter_class<lttng_session, lttng::free>::deleter>
_sessions;
};
* a proper, idiomatic, wrapper.
*/
-namespace details {
+namespace memory {
template <typename WrappedType, void (*DeleterFunction)(WrappedType *)>
-struct create_unique_class {
+struct create_deleter_class {
struct deleter {
void operator()(WrappedType *instance) const
{
return std::unique_ptr<WrappedType, deleter>(instance);
}
};
-} /* namespace details */
+} /* namespace memory */
/*
* 'free' is a utility function for use with make_unique_wrapper. It makes it easier to
template <typename WrappedType, void (*DeleterFunc)(WrappedType *)>
std::unique_ptr<WrappedType,
- typename details::create_unique_class<WrappedType, DeleterFunc>::deleter>
+ typename memory::create_deleter_class<WrappedType, DeleterFunc>::deleter>
make_unique_wrapper(WrappedType *instance)
{
- const details::create_unique_class<WrappedType, DeleterFunc> unique_deleter;
+ const memory::create_deleter_class<WrappedType, DeleterFunc> unique_deleter;
return unique_deleter(instance);
}
using uptr = std::unique_ptr<
lttng_pipe,
- lttng::details::create_unique_class<lttng_pipe, _lttng_pipe_close_wrapper>::deleter>;
+ lttng::memory::create_deleter_class<lttng_pipe, _lttng_pipe_close_wrapper>::deleter>;
/* Read: 0, Write: 1. */
int fd[2];