当前位置: 首页>>代码示例>>C++>>正文


C++ PtrList::length方法代码示例

本文整理汇总了C++中PtrList::length方法的典型用法代码示例。如果您正苦于以下问题:C++ PtrList::length方法的具体用法?C++ PtrList::length怎么用?C++ PtrList::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PtrList的用法示例。


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

示例1: send_objects

void XETP::send_objects(OutStreamP out,const PtrList &physicals,
                        Turn turn,const PtrList &tickTypes) {
  assert(physicals.length() == tickTypes.length());
  u_int totalLen = 0;
  int n;
  for (n = 0; n < physicals.length(); n++) {
    totalLen += 
      XETP::add_header(compute_object_length((PhysicalP)physicals.get(n)));
  }

  // length passed into UDP prepare_packet is bigger than the lengths 
  // passed into each XETP packet.
  if (out->get_protocol() == GenericStream::UDP) {
    ((UDPOutStreamP)out)->prepare_packet(totalLen);
  }
  
  // Send each object in turn.
  for (n = 0; n < physicals.length(); n++) {
    PhysicalP p = (PhysicalP)physicals.get(n);
    // computing object_length twice, but who cares.
    _send_object(out,p,turn,(TickType)(size_t)tickTypes.get(n),
                 compute_object_length(p));
  }
  
  if (out->get_protocol() == GenericStream::UDP) {
    ((UDPOutStreamP)out)->done_packet();
  }      
}
开发者ID:toppk,项目名称:xevil,代码行数:28,代码来源:xetp.cpp

示例2: get_button_sensitive

Boolean LAgreementDlg::get_button_sensitive(int button) {
  switch (button) {
  case PREV:
    // If not the first page.
    return currentPage > 0;
  case NEXT:
    // If not the last page.
    return currentPage < pages.length() - 1;
  case ACCEPT:
  case REJECT:
    // If the last page or if user has already seen the dialog at least
    // once.
    return viewedBefore || (currentPage == pages.length() - 1);
  case SHAREWARE_1:
  case SHAREWARE_2:
    return True;
  default:
    assert(0);
    return False;
  }
}
开发者ID:toppk,项目名称:xevil,代码行数:21,代码来源:l_agreement_dlg.cpp

示例3: _button_callback

void LAgreementDlg::_button_callback(Panel* panel) {
  // Which button was pressed.  Search through four buttons, big deal.
  int button;
  for (button = 0; button < BUTTONS_MAX; button++) {
    if (buttons[button] == panel) {
      break;
    }
  }
  assert(button < BUTTONS_MAX);


  switch (button) {
  case PREV:
    assert(currentPage > 0);
    currentPage--;
    break;
  case NEXT:
    assert(currentPage < pages.length() - 1);
    currentPage++;
    break;
  case ACCEPT:
    // So user won't have to click through it again.
    mark_as_viewed(); 
    status = ACCEPTED;
    // Don't bother with a redraw.
    return;
  case REJECT:
    status = REJECTED;
    // Don't bother with a redraw.
    return;
  default:
    assert(0);
  }

  // Update whether buttons are sensitive or not.
  for (int n = 0; n < BUTTONS_MAX; n++) {
    buttons[n]->set_sensitive(get_button_sensitive(n));
  }
  redraw();
}
开发者ID:toppk,项目名称:xevil,代码行数:40,代码来源:l_agreement_dlg.cpp


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