src/PredFinder/elf/ElfRelation.cpp
/**
 * Hash implementation for ElfRelation shared_ptrs
 * that will be used by boost::hash to generate unique
 * IDs but also by various keyed containers. Parallel to
 * the __hash__ implementation in ELF.py.
 *
 * @param relation The pointer referencing the relation
 * to be hashed.
 * @return An integer hash of the hashes of each argument
 * XORed with the hashes of the predicate and offsets.
 **/
Hash implementation for ElfRelation shared_ptrs
that will be used by boost::hash to generate unique
IDs but also by various keyed containers. Parallel to
the __hash__ implementation in ELF.py.

@param relation The pointer referencing the relation
to be hashed.
@return An integer hash of the hashes of each argument
XORed with the hashes of the predicate and offsets.
Hash implementation for ElfRelation shared_ptrs that will be used by boost :: hash to generate unique IDs but also by various keyed containers . Parallel to the __hash__ implementation in ELF . py . @param relation The pointer referencing the relation to be hashed . @return An integer hash of the hashes of each argument XORed with the hashes of the predicate and offsets .
size_t hash_value(ElfRelation_ptr const& relation) {
	boost::hash<std::wstring> string_hasher;
	boost::hash<int> int_hasher;
	size_t relation_hash = string_hasher(relation->get_name());
	relation_hash ^= int_hasher(relation->get_start().value());
	relation_hash ^= int_hasher(relation->get_end().value());
	boost::hash<ElfRelationArg_ptr> arg_hasher;
	std::vector<ElfRelationArg_ptr> args = relation->get_args();
	BOOST_FOREACH(ElfRelationArg_ptr arg, args) {
		relation_hash ^= arg_hasher(arg);
	}
	return relation_hash;
}
size_t hash_value ( ElfRelation_ptr const & relation ) { boost :: hash < std :: wstring > string_hasher ; boost :: hash < int > int_hasher ; size_t relation_hash = string_hasher ( relation -> get_name ( ) ) ; relation_hash ^= int_hasher ( relation -> get_start ( ) . value ( ) ) ; relation_hash ^= int_hasher ( relation -> get_end ( ) . value ( ) ) ; boost :: hash < ElfRelationArg_ptr > arg_hasher ; std :: vector < ElfRelationArg_ptr > args = relation -> get_args ( ) ; BOOST_FOREACH ( ElfRelationArg_ptr arg , args ) { relation_hash ^= arg_hasher ( arg ) ; } return relation_hash ; }
Hash implementation for ElfRelation shared_ptrs
 that will be used by boost::hash to generate unique
 IDs but also by various keyed containers.
Hash implementation for ElfRelation shared_ptrs that will be used by boost :: hash to generate unique IDs but also by various keyed containers .
// Hash in the predicate name and start and end offsets
 // Hash in each of the predicate's arguments
 // Done
