本文整理汇总了C++中TypedValue::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ TypedValue::getType方法的具体用法?C++ TypedValue::getType怎么用?C++ TypedValue::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypedValue
的用法示例。
在下文中一共展示了TypedValue::getType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doProcessOneResult
void FacetOperator::doProcessOneResult(const TypedValue & attributeValue, const unsigned facetFieldIndex){
if(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<std::pair<unsigned , std::string> > idsAndNames;
this->facetHelpers.at(facetFieldIndex)->generateIDAndNameForMultiValued(attributeValue , idsAndNames);
for(std::vector<std::pair<unsigned , std::string> >::iterator idAndName = idsAndNames.begin() ; idAndName != idsAndNames.end() ; ++idAndName){
this->facetResults.at(facetFieldIndex).second->addResultToBucket(idAndName->first , idAndName->second , FacetAggregationTypeCount);
}
}else{ // single value
std::pair<unsigned , std::string> idandName = this->facetHelpers.at(facetFieldIndex)->generateIDAndName(attributeValue);
this->facetResults.at(facetFieldIndex).second->addResultToBucket(idandName.first , idandName.second , FacetAggregationTypeCount);
}
}
示例2: generateIDAndNameForMultiValued
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);
}
}
}