您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Eq函数代码示例

51自学网 2021-06-01 20:38:44
  C++
这篇教程C++ Eq函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中Eq函数的典型用法代码示例。如果您正苦于以下问题:C++ Eq函数的具体用法?C++ Eq怎么用?C++ Eq使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了Eq函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TEST_F

// The purpose of this test is to ensure that when slaves are removed// from the master, and then attempt to re-register, we deny the// re-registration by sending a ShutdownMessage to the slave.// Why? Because during a network partition, the master will remove a// partitioned slave, thus sending its tasks to LOST. At this point,// when the partition is removed, the slave will attempt to// re-register with its running tasks. We've already notified// frameworks that these tasks were LOST, so we have to have the slave// slave shut down.TEST_F(PartitionTest, PartitionedSlaveReregistration){  master::Flags masterFlags = CreateMasterFlags();  Try<PID<Master>> master = StartMaster(masterFlags);  ASSERT_SOME(master);  // Allow the master to PING the slave, but drop all PONG messages  // from the slave. Note that we don't match on the master / slave  // PIDs because it's actually the SlaveObserver Process that sends  // the pings.  Future<Message> ping = FUTURE_MESSAGE(Eq("PING"), _, _);  DROP_MESSAGES(Eq("PONG"), _, _);  MockExecutor exec(DEFAULT_EXECUTOR_ID);  StandaloneMasterDetector detector(master.get());  Try<PID<Slave>> slave = StartSlave(&exec, &detector);  ASSERT_SOME(slave);  MockScheduler sched;  MesosSchedulerDriver driver(      &sched, DEFAULT_FRAMEWORK_INFO, master.get(), DEFAULT_CREDENTIAL);  EXPECT_CALL(sched, registered(&driver, _, _));  Future<vector<Offer>> offers;  EXPECT_CALL(sched, resourceOffers(&driver, _))    .WillOnce(FutureArg<1>(&offers))    .WillRepeatedly(Return());  driver.start();  AWAIT_READY(offers);  ASSERT_NE(0u, offers.get().size());  // Launch a task. This is to ensure the task is killed by the slave,  // during shutdown.  TaskID taskId;  taskId.set_value("1");  TaskInfo task;  task.set_name("");  task.mutable_task_id()->MergeFrom(taskId);  task.mutable_slave_id()->MergeFrom(offers.get()[0].slave_id());  task.mutable_resources()->MergeFrom(offers.get()[0].resources());  task.mutable_executor()->MergeFrom(DEFAULT_EXECUTOR_INFO);  task.mutable_executor()->mutable_command()->set_value("sleep 60");  // Set up the expectations for launching the task.  EXPECT_CALL(exec, registered(_, _, _, _));  EXPECT_CALL(exec, launchTask(_, _))    .WillOnce(SendStatusUpdateFromTask(TASK_RUNNING));  Future<TaskStatus> runningStatus;  EXPECT_CALL(sched, statusUpdate(&driver, _))    .WillOnce(FutureArg<1>(&runningStatus));  Future<Nothing> statusUpdateAck = FUTURE_DISPATCH(      slave.get(), &Slave::_statusUpdateAcknowledgement);  driver.launchTasks(offers.get()[0].id(), {task});  AWAIT_READY(runningStatus);  EXPECT_EQ(TASK_RUNNING, runningStatus.get().state());  // Wait for the slave to have handled the acknowledgment prior  // to pausing the clock.  AWAIT_READY(statusUpdateAck);  // Drop the first shutdown message from the master (simulated  // partition), allow the second shutdown message to pass when  // the slave re-registers.  Future<ShutdownMessage> shutdownMessage =    DROP_PROTOBUF(ShutdownMessage(), _, slave.get());  Future<TaskStatus> lostStatus;  EXPECT_CALL(sched, statusUpdate(&driver, _))    .WillOnce(FutureArg<1>(&lostStatus));  Future<Nothing> slaveLost;  EXPECT_CALL(sched, slaveLost(&driver, _))    .WillOnce(FutureSatisfy(&slaveLost));  Clock::pause();  // Now, induce a partition of the slave by having the master  // timeout the slave.  size_t pings = 0;  while (true) {    AWAIT_READY(ping);//.........这里部分代码省略.........
开发者ID:CodeTickler,项目名称:mesos,代码行数:101,


示例2: tvEqual

HOT_FUNCbool tvEqual(TypedValue tv1, TypedValue tv2) {  return tvRelOp(Eq(), tv1, tv2);}
开发者ID:vincentbdb,项目名称:hiphop-php,代码行数:4,


示例3: cellEqual

bool cellEqual(Cell cell, bool val) {  return cellRelOp(Eq(), cell, val);}
开发者ID:HendrikGrunstra,项目名称:hiphop-php,代码行数:3,


示例4: cellEqual

bool cellEqual(Cell cell, const StringData* val) {  return cellRelOp(Eq(), cell, val);}
开发者ID:vincentbdb,项目名称:hiphop-php,代码行数:3,


示例5: TEST_F

TEST_F(TextToBinaryTest, OpLine) {  EXPECT_THAT(CompiledInstructions("OpLine %srcfile 42 99"),              Eq(MakeInstruction(SpvOpLine, {1, 42, 99})));}
开发者ID:Dagarman,项目名称:mame,代码行数:4,


示例6: TEST_P

TEST_P(OpNameTest, AnyString) {  const std::string input =      std::string("OpName %target /"") + GetParam() + "/"";  EXPECT_THAT(CompiledInstructions(input),              Eq(MakeInstruction(SpvOpName, {1}, MakeVector(GetParam()))));}
开发者ID:Dagarman,项目名称:mame,代码行数:6,


示例7: return

bool wxRichTextBoxStyleDefinition::operator ==(const wxRichTextBoxStyleDefinition& def) const{    return (Eq(def));}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:4,


示例8: TEST_F

TEST_F(TestCaseIdCreatorTests, Creation_Sample_Base) {    EXPECT_THAT(TestCaseIdCreator::createBaseId("foo", 0), Eq("foo_sample"));}
开发者ID:jonathanirvings,项目名称:tcframe,代码行数:3,


示例9: lua_pushboolean

int SOPAngle::__eq(lua_State *L) {    lua_pushboolean(L, Eq(Lunar<SOPAngle>::check(L, 1)));    return 1;}
开发者ID:apaloma,项目名称:sourceop,代码行数:4,


示例10: cellEqual

bool cellEqual(Cell cell, const ResourceHdr* val) {  return cellRelOp(Eq(), cell, val);}
开发者ID:c9s,项目名称:hhvm,代码行数:3,


示例11: TEST_F

TEST_F(ScalarTests, Parsing) {    istringstream in("42");    A->parseFrom(&in);    EXPECT_THAT(a, Eq(42));}
开发者ID:jonathanirvings,项目名称:tcframe,代码行数:5,


示例12: TEST_F

TEST_F(TestCaseIdCreatorTests, SampleTestCaseIdCreation) {    EXPECT_THAT(TestCaseIdCreator::create("foo", 0, 42), Eq("foo_sample_42"));}
开发者ID:frarteaga,项目名称:tcframe,代码行数:3,


示例13: TEST_F

 TEST_F(ToDoTest, constructor_createsEmptyList) {     EXPECT_THAT(list.size(), Eq(size_t(0))); }
开发者ID:jensBrunel,项目名称:TestRepo,代码行数:4,


示例14: begin

voidbegin (int argc, const char * argv[]){  size_t infile;  size_t n_fields;  size_t field;  size_t n_params;  size_t param;  const char * comment;  int mer_field[256] = {0, };  infile = Infile ("-");  File_fix (infile, 1, 0);  puts ("#: taql-0.1/text");  n_fields = N_fields (infile);  for (field = 0; field < n_fields; ++field)    {      Taql name;      Taql type;      fputs ("# field ", stdout);      name = Field_name (infile, field);      Fprint (stdout, name);      fputs (" ", stdout);      type = Field_type (infile, field);      Fprint (stdout, type);      fputc ('/n', stdout);      if (   Eq (type, Sym ("uint64"))          && ('m' == Sym_ref(name, 0))          && ('e' == Sym_ref(name, 1))          && ('r' == Sym_ref(name, 2))          && isdigit (Sym_ref(name, 3)))        {          mer_field[field] = 1;        }    }  n_params = N_params (infile);  for (param = 0; param < n_params; ++param)    {      fputs ("# param ", stdout);      Fprint (stdout, Param_name (infile, param));      fputs (" ", stdout);      Fprint (stdout, Param_value (infile, param));      fputc ('/n', stdout);    }  comment = Comment (infile);  if (!comment || !comment[0])    {      fputs ("#./n", stdout);    }  else    {      const char * c;      fputs ("#-/n# ", stdout);      for (c = comment; *c; ++c)        {          if (*c == '/n')            fputs ("/n# ", stdout);          else            fputc (*c, stdout);        }      fputs ("/n#./n", stdout);    }  while (N_ahead (infile))    {      for (field = 0; field < n_fields; ++field)        {          Taql value;          if (field)            fputc (' ', stdout);          value = Peek (infile, 0, field);          if (!mer_field [field])            {              Fprint (stdout, value);            }          else            {              t_taql_uint64 mer;              char in_ascii[17];              mer = as_uInt64 (value);              mer_to_ascii (in_ascii, mer);              fputs (in_ascii, stdout);            }        }      fputc ('/n', stdout);      Advance (infile, 1);    }}
开发者ID:curoverse,项目名称:warehouse-apps,代码行数:99,



注:本文中的Eq函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ EqualRect函数代码示例
C++ Eof函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。