예제 #1
0
TEST_F(ConversionsTests, test_conversion) {
  boost::shared_ptr<Foobar> b1 = boost::make_shared<Foobar>();
  std::shared_ptr<Foobar> s1 = boost_to_std_shared_ptr(b1);
  EXPECT_EQ(s1.get(), b1.get());

  std::shared_ptr<Foobar> s2 = std::make_shared<Foobar>();
  boost::shared_ptr<Foobar> b2 = std_to_boost_shared_ptr(s2);
  EXPECT_EQ(s2.get(), b2.get());
}
예제 #2
0
Dispatcher::Dispatcher() {
#ifdef FBOSQUERY
  thread_manager_ = ThreadManager::newSimpleThreadManager(
      (size_t)FLAGS_worker_threads, 0);
  auto threadFactory =
      std::shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
#else
  thread_manager_ = boost_to_std_shared_ptr(
      ThreadManager::newSimpleThreadManager((size_t)FLAGS_worker_threads, 0));
  auto threadFactory =
      boost::shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
#endif
  thread_manager_->threadFactory(threadFactory);
  thread_manager_->start();
}