Skip to content

Commit

Permalink
Rename adoptVector into getVector
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrzewic committed Oct 30, 2018
1 parent a3e7312 commit f6d8e63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions fairmq/MemoryResourceTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ FairMQMessagePtr getMessage(ContainerT &&container_, FairMQMemoryResource *targe
/// Resource must be kept alive throughout the lifetime of the
/// container and associated message.
template<typename ElemT>
std::vector<const ElemT, boost::container::pmr::polymorphic_allocator<const ElemT>> adoptVector(
std::vector<const ElemT, boost::container::pmr::polymorphic_allocator<const ElemT>> getVector(
size_t nelem,
SpectatorMessageResource *resource)
{
Expand All @@ -78,7 +78,7 @@ std::vector<const ElemT, boost::container::pmr::polymorphic_allocator<const Elem
/// Return a vector of const ElemT, takes ownership of the message
template<typename ElemT>
std::vector<const ElemT, OwningMessageSpectatorAllocator<const ElemT>>
adoptVector(size_t nelem, FairMQMessagePtr message)
getVector(size_t nelem, FairMQMessagePtr message)
{
return std::vector<const ElemT, OwningMessageSpectatorAllocator<const ElemT>>(
nelem,
Expand All @@ -93,7 +93,7 @@ std::vector<const ElemT, OwningMessageSpectatorAllocator<const ElemT>>
// semantics for access.
// use auto or decltype to catch the return type.
// template<typename ElemT>
// auto adoptVector(size_t nelem, FairMQMessage* message)
// auto getVector(size_t nelem, FairMQMessage* message)
//{
// using DataType = std::vector<ElemT, ByteSpectatorAllocator>;
//
Expand Down
2 changes: 1 addition & 1 deletion test/memory_resources/_memory_resources.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ TEST(MemoryResources, adoptVector_test)
std::memcpy(message->GetData(), tmpBuf, 3 * sizeof(testData));

auto adoptedOwner =
adoptVector<testData>(3, std::move(message));
getVector<testData>(3, std::move(message));
EXPECT_TRUE(adoptedOwner[0].i == 3);
EXPECT_TRUE(adoptedOwner[1].i == 2);
EXPECT_TRUE(adoptedOwner[2].i == 1);
Expand Down

0 comments on commit f6d8e63

Please sign in to comment.