Alias boost::container::pmr -> fair::mq::pmr

so the eventual switch to std::pmr becomes easier
This commit is contained in:
mkrzewic 2018-10-30 14:56:48 +01:00 committed by Dennis Klein
parent 34286ef75e
commit f9658f69a4
3 changed files with 6 additions and 5 deletions

View File

@ -18,14 +18,14 @@
namespace fair { namespace fair {
namespace mq { namespace mq {
using BytePmrAllocator = boost::container::pmr::polymorphic_allocator<fair::mq::byte>; using BytePmrAllocator = pmr::polymorphic_allocator<fair::mq::byte>;
//_________________________________________________________________________________________________ //_________________________________________________________________________________________________
// return the message associated with the container or throw if it is not possible // return the message associated with the container or throw if it is not possible
template<typename ContainerT> template<typename ContainerT>
// typename std::enable_if< // typename std::enable_if<
// std::is_base_of< // std::is_base_of<
// boost::container::pmr::polymorphic_allocator<typename // pmr::polymorphic_allocator<typename
// ContainerT::value_type>, // ContainerT::value_type>,
// typename ContainerT::allocator_type>::value == true, // typename ContainerT::allocator_type>::value == true,
// FairMQMessagePtr>::type // FairMQMessagePtr>::type

View File

@ -33,11 +33,12 @@ namespace fair {
namespace mq { namespace mq {
using byte = unsigned char; using byte = unsigned char;
namespace pmr = boost::container::pmr;
/// All FairMQ related memory resources need to inherit from this interface /// All FairMQ related memory resources need to inherit from this interface
/// class for the /// class for the
/// getMessage() api. /// getMessage() api.
class FairMQMemoryResource : public boost::container::pmr::memory_resource class FairMQMemoryResource : public pmr::memory_resource
{ {
public: public:
/// return the message containing data associated with the pointer (to start /// return the message containing data associated with the pointer (to start
@ -103,7 +104,7 @@ class ChannelResource : public FairMQMemoryResource
messageMap.erase(p); messageMap.erase(p);
}; };
bool do_is_equal(const boost::container::pmr::memory_resource &other) const noexcept override bool do_is_equal(const pmr::memory_resource &other) const noexcept override
{ {
return this == &other; return this == &other;
}; };

View File

@ -71,7 +71,7 @@ TEST(MemoryResources, transportallocatormap_test)
EXPECT_TRUE(_tmp == allocZMQ); EXPECT_TRUE(_tmp == allocZMQ);
} }
using namespace boost::container::pmr; using namespace fair::mq::pmr;
TEST(MemoryResources, allocator_test) TEST(MemoryResources, allocator_test)
{ {