Example #1
0
void InputColumnDeriver::Visit(const PhysicalOrderBy *) {
  // we need to pass down both required columns and sort columns
  auto prop = properties_->GetPropertyOfType(PropertyType::SORT);
  PELOTON_ASSERT(prop.get() != nullptr);
  ExprSet input_cols_set;
  for (auto expr : required_cols_) {
    if (expression::ExpressionUtil::IsAggregateExpression(expr)) {
      input_cols_set.insert(expr);
    } else {
      expression::ExpressionUtil::GetTupleValueExprs(input_cols_set, expr);
    }
  }
  auto sort_prop = prop->As<PropertySort>();
  size_t sort_col_size = sort_prop->GetSortColumnSize();
  for (size_t idx = 0; idx < sort_col_size; ++idx) {
    input_cols_set.insert(sort_prop->GetSortColumn(idx));
  }
  vector<AbstractExpression *> cols;
  for (auto &expr : input_cols_set) {
    cols.push_back(expr);
  }
  output_input_cols_ =
      pair<vector<AbstractExpression *>, vector<vector<AbstractExpression *>>>{
          cols, {cols}};
}
Example #2
0
void CComputerGrid::AutoSort()
{
	if (CIBAConfig::GetInstance()->GetEnmergencyVisible() && IsSortingMode())
	{	
		INT nCol = GetSortColumn();

		BOOL bAscending = (GetColumnsInfo().GetColumnState(nCol) == 1); //正序排列

		Sort(nCol, bAscending);
	}
}
Example #3
0
void HaliteDialog::DialogListView::uiUpdate(const hal::torrent_details_manager& tD) 
{	
	if (hal::try_update_lock<list_class_t> lock{ this })
	{		
		selection_from_listview();
		
		peer_details_.clear();
		
		BOOST_FOREACH (const hal::uuid& id, tD.selected_uuids())
		{
			if (const hal::torrent_details_ptr t = tD.get(id))
				std::copy(t->get_peer_details().begin(), t->get_peer_details().end(), 
					std::inserter(peer_details_, peer_details_.begin()));
		}
		
		std::set<std::wstring> ip_set;
		BOOST_FOREACH (const hal::peer_detail& pd,  peer_details_)
			ip_set.insert(pd.ip_address);
		
		erase_based_on_set(ip_set, true);

		if (IsSortOnce() || AutoSort())
		{
			if (GetSecondarySortColumn() != -1)
			{
				int index = GetColumnSortType(GetSecondarySortColumn());					
				if (index > WTL::LVCOLSORT_LAST)
					sort(index - (WTL::LVCOLSORT_LAST+1+hal::peer_detail::ip_address_e), IsSecondarySortDescending());
			}

			if (GetSortColumn() != -1)
			{		
				int index = GetColumnSortType(GetSortColumn());				
				if (index > WTL::LVCOLSORT_LAST)
					sort(index - (WTL::LVCOLSORT_LAST+1+hal::peer_detail::ip_address_e), IsSortDescending());
			}
		}
		
		set_keys(ip_set);		
		InvalidateRect(NULL,true);
	}