Skip to content

Commit

Permalink
Merge pull request #14 from leapmotion/dep-moveonly
Browse files Browse the repository at this point in the history
Deprecate MoveOnly
  • Loading branch information
gtremper committed Jul 31, 2014
2 parents 54a06fe + d2ce96b commit ec81b77
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 48 deletions.
22 changes: 0 additions & 22 deletions autowiring/move_only.h

This file was deleted.

6 changes: 2 additions & 4 deletions src/autowiring/BasicThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "BasicThreadStateBlock.h"
#include "ContextEnumerator.h"
#include "fast_pointer_cast.h"
#include "move_only.h"

// Explicit instantiation of supported time point types:
template<> bool BasicThread::WaitUntil(std::chrono::steady_clock::time_point);
Expand Down Expand Up @@ -146,10 +145,9 @@ bool BasicThread::Start(std::shared_ptr<Object> outstanding) {
}

// Kick off a thread and return here
MoveOnly<std::shared_ptr<Object>> out(std::move(outstanding));
m_state->m_thisThread = std::thread(
[this, out] {
this->DoRun(std::move(out.value));
[this, outstanding] () mutable {
this->DoRun(std::move(outstanding));
}
);
return true;
Expand Down
1 change: 0 additions & 1 deletion src/autowiring/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ set(Autowiring_SRCS
ObjectPoolMonitor.cpp
optional_ptr.h
SatCounter.h
move_only.h
MicroBolt.h
SharedPointerSlot.h
SlotInformation.h
Expand Down
1 change: 0 additions & 1 deletion src/autowiring/CoreJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "stdafx.h"
#include "CoreJob.h"
#include "CoreContext.h"
#include "move_only.h"

CoreJob::CoreJob(const char* name) :
ContextMember(name),
Expand Down
21 changes: 1 addition & 20 deletions src/autowiring/test/CoreJobTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "stdafx.h"
#include "CoreJobTest.hpp"
#include <autowiring/CoreJob.h>
#include <autowiring/move_only.h>
#include THREAD_HEADER
#include FUTURE_HEADER

Expand All @@ -12,7 +11,7 @@ TEST_F(CoreJobTest, VerifySimpleProperties) {
ASSERT_FALSE(m_create->IsInitiated()) << "CoreJob reported it could receive events before its enclosing context was created";

// Create a thread which will delay for acceptance, and then quit:
auto future = std::async(std::launch::async, [this] { //GRAHAM
auto future = std::async(std::launch::async, [this] {
m_create->DelayUntilInitiated();
});

Expand Down Expand Up @@ -101,24 +100,6 @@ TEST_F(CoreJobTest, VerifyNoEventReceivers){
EXPECT_FALSE(listener->m_flag) << "Lister recived event event though it wasn't initiated";
}

class CanOnlyMove {
public:
CanOnlyMove(){}
~CanOnlyMove(){}
CanOnlyMove(const CanOnlyMove& derp) = delete;
CanOnlyMove(CanOnlyMove&& derp){}
};

TEST_F(CoreJobTest, MoveOnly){
CanOnlyMove move;
//CanOnlyMove derp = move; //error

MoveOnly<CanOnlyMove> mo(std::move(move));

MoveOnly<CanOnlyMove> first = mo;
//MoveOnly<CanOnlyMove> second = mo; //error
}

TEST_F(CoreJobTest, AbandonedDispatchers) {
auto v = std::make_shared<bool>(false);

Expand Down

0 comments on commit ec81b77

Please sign in to comment.