Пример #1
0
boost::test_tools::predicate_result
compare_uuids( boost::uuids::uuid const& a, boost::uuids::uuid const& b )
{
    if (a.is_nil())
    {
        boost::test_tools::predicate_result res( false );

        res.message() << "UUID a was nil";

        return res;
    
    }

    if (b.is_nil())
    {
        boost::test_tools::predicate_result res( false );

        res.message() << "UUID b was nil";

        return res;
    
    }

    if (a == b)
    {
        boost::test_tools::predicate_result res( false );

        res.message() << "UUID A and B are equal with value '" << a << "'";

        return res;
    }

    return true;
}
Пример #2
0
LPCTSTR Dispatcher::className(const std::string& name) {
	// Convert to wide
	std::basic_stringstream<TCHAR> stream;
	stream << name.c_str();

#ifdef DWT_SHARED
	/* in a shared library, classes registered by the lib can't clash with those regged by the host
	or by other dynamically loaded libs. append a unique string to that end. */
	static boost::uuids::uuid uuid;
	if(uuid.is_nil()) {
		uuid = boost::uuids::random_generator()();
	}
	stream << uuid;
#endif

	classNames.push_back(stream.str());
	return classNames.back().c_str();
}
Пример #3
0
 static bool is_null(boost::uuids::uuid const& id)
 {
     return id.is_nil();
 }
Пример #4
0
void SelectWeightsDlg::SetDetailsForId(boost::uuids::uuid id)
{
	LOG_MSG("In SelectWeightsDlg::SetDetailsForItem");
	if (id.is_nil()) {
		SetDetailsWin(std::vector<wxString>(0), std::vector<wxString>(0));
		return;
	}
	std::vector<wxString> row_title;
	std::vector<wxString> row_content;
	
	WeightsMetaInfo wmi = w_man_int->GetMetaInfo(id);
	
	row_title.push_back("type");
	row_content.push_back(wmi.TypeToStr());
	
	row_title.push_back("symmetry");
	row_content.push_back(wmi.SymToStr());
	
	row_title.push_back("file");
	if (wmi.filename.IsEmpty()) {
		row_content.push_back("not saved");
	} else {
        wxFileName fm(wmi.filename);
		row_content.push_back(fm.GetFullName());
	}
	
	row_title.push_back("id variable");
	row_content.push_back(wmi.id_var);
	
	if (wmi.weights_type == WeightsMetaInfo::WT_rook ||
		wmi.weights_type == WeightsMetaInfo::WT_queen) {
		row_title.push_back("order");
		wxString rs;
		rs << wmi.order;
		row_content.push_back(rs);
		if (wmi.order > 1) {
			row_title.push_back("include lower orders");
			if (wmi.inc_lower_orders) {
				row_content.push_back("true");
			} else {
				row_content.push_back("false");
			}
		}
	} else if (wmi.weights_type == WeightsMetaInfo::WT_knn ||
			   wmi.weights_type == WeightsMetaInfo::WT_threshold) {
		row_title.push_back("distance metric");
		row_content.push_back(wmi.DistMetricToStr());

		row_title.push_back("distance vars");
		row_content.push_back(wmi.DistValsToStr());
		
		if (wmi.weights_type == WeightsMetaInfo::WT_threshold) {
			row_title.push_back("distance unit");
			row_content.push_back(wmi.DistUnitsToStr());
		}
		
		if (wmi.weights_type == WeightsMetaInfo::WT_knn) {
			row_title.push_back("neighbors");
			wxString rs;
			rs << wmi.num_neighbors;
			row_content.push_back(rs);
		} else {
			row_title.push_back("threshold value");
			wxString rs;
			rs << wmi.threshold_val;
			row_content.push_back(rs);
		}
	}
	LOG(row_title.size());
	LOG(row_content.size());
	SetDetailsWin(row_title, row_content);
}