2021-03-30 06:00:20 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* \section COPYRIGHT
|
|
|
|
*
|
|
|
|
* Copyright 2013-2021 Software Radio Systems Limited
|
|
|
|
*
|
|
|
|
* By using this file, you agree to the terms and conditions set
|
|
|
|
* forth in the LICENSE file which can be found at the top level of
|
|
|
|
* the distribution.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SRSRAN_POOL_UTILS_H
|
|
|
|
#define SRSRAN_POOL_UTILS_H
|
|
|
|
|
|
|
|
#include "../move_callback.h"
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace srsran {
|
|
|
|
|
|
|
|
namespace detail {
|
|
|
|
|
|
|
|
template <typename T>
|
2021-04-01 08:28:29 -07:00
|
|
|
struct inplace_default_ctor_operator {
|
2021-03-30 06:00:20 -07:00
|
|
|
void operator()(void* ptr) { new (ptr) T(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct noop_operator {
|
|
|
|
template <typename T>
|
|
|
|
void operator()(const T& ptr)
|
|
|
|
{
|
|
|
|
// do nothing
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace detail
|
|
|
|
|
|
|
|
} // namespace srsran
|
|
|
|
|
|
|
|
#endif // SRSRAN_POOL_UTILS_H
|