src/PredFinder/elf/ElfRelation.cpp
/**
 * Gets the first ElfRelationArg for a given role, if any.
 * The returned argument is a direct reference, not a copy.
 *
 * @return The first matching ElfRelationArg, or null.
 *
 * @author nward@bbn.com
 * @date 2010.10.13
 **/
Gets the first ElfRelationArg for a given role, if any.
The returned argument is a direct reference, not a copy.

@return The first matching ElfRelationArg, or null.


Gets the first ElfRelationArg for a given role if any . The returned argument is a direct reference not a copy . @return The first matching ElfRelationArg or null .
ElfRelationArg_ptr ElfRelation::get_arg(const std::wstring & role) const {
	ElfRelationArg_ptr arg;
	ElfRelationArgMap::const_iterator args_i = _arg_map.find(role);
	if (args_i != _arg_map.end()) {
		if (args_i->second.size() > 0) {
			if (args_i->second.size() > 1) {
				SessionLogger::err("LEARNIT") << L"WARNING: (ElfRelation::get_arg) getting only first arg for role " << role << L". Multiple args with that role exist. Results will likely be inconsistent.\n";
				SessionLogger::err("LEARNIT") << this->toDebugString(0) << "\n";
			}
			return args_i->second[0];
		}
	}
	return arg;
}
ElfRelationArg_ptr ElfRelation :: get_arg ( const std :: wstring & role ) const { ElfRelationArg_ptr arg ; ElfRelationArgMap :: const_iterator args_i = _arg_map . find ( role ) ; if ( args_i != _arg_map . end ( ) ) { if ( args_i -> second . size ( ) > 0 ) { if ( args_i -> second . size ( ) > 1 ) { SessionLogger :: err ( " " ) << L" " << role << L" \n " ; SessionLogger :: err ( " " ) << this -> toDebugString ( 0 ) << " \n " ; } return args_i -> second [ 0 ] ; } } return arg ; }
Gets the first ElfRelationArg for a given role, if any.
Gets the first ElfRelationArg for a given role if any .