コード例 #1
0
TEST(CoreTiming, SharedSlot)
{
  ScopeInit guard;

  CoreTiming::EventType* cb_a = CoreTiming::RegisterEvent("callbackA", CallbackTemplate<0>);
  CoreTiming::EventType* cb_b = CoreTiming::RegisterEvent("callbackB", CallbackTemplate<1>);
  CoreTiming::EventType* cb_c = CoreTiming::RegisterEvent("callbackC", CallbackTemplate<2>);
  CoreTiming::EventType* cb_d = CoreTiming::RegisterEvent("callbackD", CallbackTemplate<3>);
  CoreTiming::EventType* cb_e = CoreTiming::RegisterEvent("callbackE", CallbackTemplate<4>);

  CoreTiming::ScheduleEvent(1000, cb_a, CB_IDS[0]);
  CoreTiming::ScheduleEvent(1000, cb_b, CB_IDS[1]);
  CoreTiming::ScheduleEvent(1000, cb_c, CB_IDS[2]);
  CoreTiming::ScheduleEvent(1000, cb_d, CB_IDS[3]);
  CoreTiming::ScheduleEvent(1000, cb_e, CB_IDS[4]);

  // Enter slice 0
  CoreTiming::Advance();
  EXPECT_EQ(1000, PowerPC::ppcState.downcount);

  s_callbacks_ran_flags = 0;
  s_lateness = 0;
  s_expected_callback = 0;
  PowerPC::ppcState.downcount = 0;
  CoreTiming::Advance();
  EXPECT_EQ(MAX_SLICE_LENGTH, PowerPC::ppcState.downcount);
  EXPECT_EQ(0x1FULL, s_callbacks_ran_flags.to_ullong());
}
コード例 #2
0
 //! Serializing (save) for std::bitset
 template <class Archive, size_t N> inline
 void save( Archive & ar, std::bitset<N> const & bits )
 {
   try
   {
     auto const b = bits.to_ulong();
     ar( _CEREAL_NVP("type", bitset_detail::type::ulong) );
     ar( _CEREAL_NVP("data", b) );
   }
   catch( std::overflow_error const & )
   {
     try
     {
       auto const b = bits.to_ullong();
       ar( _CEREAL_NVP("type", bitset_detail::type::ullong) );
       ar( _CEREAL_NVP("data", b) );
     }
     catch( std::overflow_error const & )
     {
       ar( _CEREAL_NVP("type", bitset_detail::type::string) );
       ar( _CEREAL_NVP("data", bits.to_string()) );
     }
   }
 }
コード例 #3
0
ファイル: ShuttleBitset.hpp プロジェクト: eidolonsystems/beam
 void operator ()(Shuttler& shuttle, const char* name,
     std::bitset<N> value) const {
   std::uint64_t v = static_cast<std::uint64_t>(value.to_ullong());
   shuttle.Send(name, v);
 }