本文整理汇总了C++中TrivialArray::end方法的典型用法代码示例。如果您正苦于以下问题:C++ TrivialArray::end方法的具体用法?C++ TrivialArray::end怎么用?C++ TrivialArray::end使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrivialArray
的用法示例。
在下文中一共展示了TrivialArray::end方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
WifiListWidget::NetworkInfo *
WifiListWidget::FindVisibleBySSID(const char *ssid)
{
auto f = std::find_if(networks.begin(), networks.end(),
[ssid](const NetworkInfo &info) {
return info.signal_level >= 0 && info.ssid == ssid;
});
if (f == networks.end())
return nullptr;
return f;
}
示例2: SetPointType
bool
dlgTaskPointType(OrderedTask &task, const unsigned index)
{
point_types.clear();
task.GetFactory().GetValidTypes(index)
.CopyTo(std::back_inserter(point_types));
if (point_types.empty()) {
assert(1);
return false;
}
if (point_types.size() == 1)
return SetPointType(task, index, point_types[0]);
const auto &point = task.GetPoint(index);
const auto current_type = task.GetFactory().GetType(point);
unsigned initial_index = 0;
const auto b = point_types.begin(), e = point_types.end();
auto i = std::find(b, e, current_type);
if (i != e)
initial_index = std::distance(b, i);
MutateTaskPointRenderer item_renderer(current_type);
int result = ListPicker(_("Task Point Type"),
point_types.size(), initial_index,
item_renderer.CalculateLayout(UIGlobals::GetDialogLook()),
item_renderer, false,
nullptr, TPTypeItemHelp);
return result >= 0 && SetPointType(task, index, point_types[result]);
}
示例3: SetPointType
bool
dlgTaskPointType(OrderedTask** task, const unsigned index)
{
ordered_task = *task;
active_index = index;
point = &ordered_task->GetPoint(active_index);
point_types.clear();
ordered_task->GetFactory().GetValidTypes(index)
.CopyTo(std::back_inserter(point_types));
if (point_types.empty()) {
assert(1);
return false;
}
if (point_types.size() == 1)
return SetPointType(point_types[0]);
unsigned initial_index = 0;
const auto b = point_types.begin(), e = point_types.end();
auto i = std::find(b, e, get_point_type());
if (i != e)
initial_index = std::distance(b, i);
FunctionListItemRenderer item_renderer(OnPointPaintListItem);
int result = ListPicker(_("Task Point Type"),
point_types.size(), initial_index,
Layout::Scale(18),
item_renderer, false,
nullptr, TPTypeItemHelp);
return result >= 0 && SetPointType(point_types[result]);
}
示例4: distance
int
ManagedFileListWidget::FindItem(const TCHAR *name) const
{
for (auto i = items.begin(), end = items.end(); i != end; ++i)
if (StringIsEqual(i->name, name))
return std::distance(items.begin(), i);
return -1;
}
示例5: GetList
void
NOAAListWidget::UpdateList()
{
stations.clear();
for (auto i = noaa_store->begin(), end = noaa_store->end(); i != end; ++i) {
NOAAListItem item;
item.code = i->GetCodeT();
item.iterator = i;
stations.push_back(item);
}
std::sort(stations.begin(), stations.end());
ListControl &list = GetList();
list.SetLength(stations.size());
list.Invalidate();
const bool empty = stations.empty(), full = stations.full();
add_button->SetEnabled(!full);
update_button->SetEnabled(!empty);
remove_button->SetEnabled(!empty);
details_button->SetEnabled(!empty);
}
示例6:
/**
* Search for the last traffic in the ordered list.
*/
const FlarmTraffic *LastTraffic() const {
return list.empty() ? NULL : list.end() - 1;
}
示例7: WndCustomButton
void
dlgQuickMenuShowModal(SingleWindow &parent)
{
const Menu *menu = InputEvents::GetMenu(_T("RemoteStick"));
if (menu == NULL)
return;
const DialogLook &dialog_look = UIGlobals::GetDialogLook();
WindowStyle dialogStyle;
dialogStyle.Hide();
dialogStyle.ControlParent();
wf = new WndForm(parent, dialog_look, parent.get_client_rect(),
_T("Quick Menu"), dialogStyle);
ContainerWindow &client_area = wf->GetClientAreaWindow();
PixelRect r = client_area.get_client_rect();
WindowStyle grid_view_style;
grid_view_style.ControlParent();
grid_view = new GridView(client_area,
r.left, r.top,
r.right - r.left, r.bottom - r.top,
dialog_look, grid_view_style);
WindowStyle buttonStyle;
buttonStyle.TabStop();
for (unsigned i = 0; i < menu->MAX_ITEMS; ++i) {
if (buttons.full())
continue;
const MenuItem &menuItem = (*menu)[i];
if (!menuItem.IsDefined())
continue;
TCHAR buffer[100];
ButtonLabel::Expanded expanded =
ButtonLabel::Expand(menuItem.label, buffer, ARRAY_SIZE(buffer));
if (!expanded.visible)
continue;
PixelRect button_rc;
button_rc.left = 0;
button_rc.top = 0;
button_rc.right = 80;
button_rc.bottom = 30;
WndButton *button =
new WndCustomButton(*grid_view, dialog_look, expanded.text,
button_rc, buttonStyle, OnButtonClicked);
button->set_enabled(expanded.enabled);
buttons.append(button);
events.append(menuItem.event);
}
grid_view->SetItems(buttons);
SetFormDefaultFocus();
SetFormCaption();
wf->SetKeyDownNotify(FormKeyDown);
wf->ShowModal();
for (auto it = buttons.begin(), end = buttons.end(); it != end; ++it)
delete *it;
buttons.clear();
events.clear();
delete wf;
delete grid_view;
}