示例#1
0
void FacetHelper::generateIDAndNameForMultiValued(const TypedValue & attributeValue ,
		std::vector< std::pair<unsigned , std::string> > & resultIdsAndNames){
	ASSERT(attributeValue.getType() == ATTRIBUTE_TYPE_MULTI_INT ||
	        attributeValue.getType() == ATTRIBUTE_TYPE_MULTI_LONG ||
			attributeValue.getType() == ATTRIBUTE_TYPE_MULTI_FLOAT ||
			attributeValue.getType() == ATTRIBUTE_TYPE_MULTI_DOUBLE ||
			attributeValue.getType() == ATTRIBUTE_TYPE_MULTI_TEXT ||
			attributeValue.getType() == ATTRIBUTE_TYPE_MULTI_TIME);
	std::vector<TypedValue> singleValues;
	attributeValue.breakMultiValueIntoSingleValueTypedValueObjects(&singleValues);
	for(std::vector<TypedValue>::iterator singleValue = singleValues.begin() ; singleValue != singleValues.end() ; ++singleValue){
		std::pair<unsigned, std::string>  idAndNamePair = generateIDAndName(*singleValue);
		if(std::find(resultIdsAndNames.begin() , resultIdsAndNames.end() , idAndNamePair) == resultIdsAndNames.end()){
			resultIdsAndNames.push_back(idAndNamePair);
		}
	}
}