Exemple #1
0
 result_type operator()(const argument_type& volume) const
 {
   size_t seed = 0;
   boost::hash_combine(seed, std::hash<std::string>()(volume.driver()));
   boost::hash_combine(seed, std::hash<std::string>()(volume.name()));
   return seed;
 }
Exemple #2
0
 std::size_t operator()(argument_type const& val)
 {
     return hash<typename argument_type::position_type>()(val.position()) ^
         hash<typename argument_type::length_type>()(val.radius()) ^
         hash<typename argument_type::position_type>()(val.unit_z()) ^
         hash<typename argument_type::length_type>()(val.half_length());
 }
Exemple #3
0
 result_type operator()(const argument_type& range) const
 {
   size_t seed = 0;
   boost::hash_combine(seed, range.begin());
   boost::hash_combine(seed, range.end());
   return seed;
 }
Exemple #4
0
 result_type operator()(const argument_type& machineId) const
 {
   size_t seed = 0;
   boost::hash_combine(seed, strings::lower(machineId.hostname()));
   boost::hash_combine(seed, machineId.ip());
   return seed;
 }
Exemple #5
0
    result_type operator() (argument_type line)
    {
        if( !m_parsing )
        {
            std::string::size_type start = line.find("$(IF ", 0);
            std::string::size_type end = line.find(')', start);

            std::string symbol = line.substr(start + 5, end - start - 5);

            // if the symbol exists in the map, parse normally until we hit $(END)
            // if it doesn't exist, skip until we hit $(END)
            m_output = symbols.find(symbol) != symbols.end();
            m_parsing = true;
        }
        else
        {
            // look for $(END)
            if( line.find("$(END)") != std::string::npos )
            {
                // stop parsing
                m_parsing = false;
                parsers.erase(parsers.end()-1);
                return true;
            }
            
            symbol_parser::m_should_output = m_output;
            return false;
        }

        return true;
    }
PositionSave::result_type
PositionSave::operator()(argument_type ss) {
	// ss = special sprite (actor)
	p.insert(
	 *new std::pair<GameSprite *const, SDL_Rect>(ss, *new SDL_Rect));
	p[ss].x = ss->GetX();
	p[ss].y = ss->GetY();
} // PositionSave()
Exemple #7
0
 std::size_t operator()(argument_type const& val)
 {
     return hash<argument_type::position_type>()(val.position()) ^
         hash<argument_type::length_type>()(val.radius()) ^
         hash<argument_type::D_type>()(val.D()) ^
         // hash<argument_type::species_type>()(val.species());
         hash<argument_type::species_serial_type>()(val.sid());
 }
Exemple #8
0
 std::size_t operator()(argument_type const& val)
 {
     return hash<typename argument_type::position_type>()(val.position()) ^
         hash<typename argument_type::position_type>()(val.unit_x()) ^
         hash<typename argument_type::position_type>()(val.unit_y()) ^
         hash<typename argument_type::length_type>()(val.half_extent()[0]) ^
         hash<typename argument_type::length_type>()(val.half_extent()[1]);
 }
Exemple #9
0
  result_type operator()(const argument_type& ip) const
  {
    size_t seed = 0;

    switch (ip.family()) {
      case AF_INET:
        boost::hash_combine(seed, htonl(ip.in().get().s_addr));
        return seed;
      default:
        UNREACHABLE();
    }
  }
Exemple #10
0
  result_type operator()(const argument_type& containerId) const
  {
    size_t seed = 0;
    boost::hash_combine(seed, containerId.value());

    if (containerId.has_parent()) {
      boost::hash_combine(
          seed,
          std::hash<mesos::ContainerID>()(containerId.parent()));
    }

    return seed;
  }
Exemple #11
0
  result_type operator()(const argument_type& uri) const
  {
    size_t seed = 0;

    if (uri.extract()) {
      seed += 11;
    }

    if (uri.executable()) {
      seed += 2003;
    }

    boost::hash_combine(seed, uri.value());
    return seed;
  }
Exemple #12
0
void
LocationPointRead::
operator () ( argument_type &t )
{
	ostringstream q;
	boost::posix_time::ptime refTime;
	string validTime;
	bool disabled;
	int dataversion;

	WEBFW_USE_LOGGER( "wdb" );

	if( to_.is_special() )
		validTime = "NULL";
	else
		validTime = wciTimeSpec( wciProtocol_,
				                 boost::posix_time::ptime( boost::posix_time::neg_infin), to_ );


	for( ParamDefList::const_iterator itPar=paramDefs_.begin();
		itPar != paramDefs_.end();
		++itPar )
	{
		if( ! refTimeList_.providerReftimeDisabledAndDataversion(itPar->first,
		                                                         refTime,
		                                                         disabled,
		                                                         dataversion ) ) {
			WEBFW_LOG_WARN("No reference times found for provider '" << itPar->first << "'." <<
					        "Check that the provider is listed in provider_priority.");
			continue;
		}

		if( disabled ) {
		   WEBFW_LOG_WARN("Provider '" << itPar->first << "' disabled." );
		   continue;
		}

		if( dataversion < -1 )
		   dataversion = -1;

		q.str("");

		q << "SELECT " << wciReadReturnColoumns( wciProtocol_ ) << " FROM wci.read(" << endl
	      << "ARRAY['" << itPar->first << "'], " << endl
	      << "'nearest POINT(" << longitude_ << " " << latitude_ << ")', " << endl
	      << wciTimeSpec( wciProtocol_, refTime ) << ", " << endl
	      << validTime << ", " << endl
	      << wciValueParameter( wciProtocol_, itPar->second ) << ", " << endl
	      << "NULL, " << endl
	      << "ARRAY[" << dataversion << "], NULL::wci.returnfloat ) ORDER BY referencetime";

		WEBFW_LOG_DEBUG( "LocationPointRead: transactor: SQL ["	<< q.str() << "]" );
		pqxx::result  res = t.exec( q.str() );

		//miutil::container::PqContainer container( res );
		decodePData( paramDefs_, providers_, refTimeList_, res, false, *locationPointData_, wciProtocol_ );
	}
}
	result_type operator()(argument_type pNdasLogicalUnit) const
	{
		BOOL hidden;
		if (SUCCEEDED(pNdasLogicalUnit->get_IsHidden(&hidden)) && hidden)
		{
			return true;
		}
		return false;
	}
Exemple #14
0
hash<ObjectId>::result_type hash<ObjectId>::operator()(argument_type const& id) const {
	result_type result;
	switch (id.subtype) {
	default:
	case ObjectIdKind::Null:
		return 0;
	case ObjectIdKind::Prototype:
		return sIntHasher(id.GetPrototypeId());
	case ObjectIdKind::Permanent:
		result = sHandleHasher(*(uint64_t*)&id.body.guid.Data1);
		result ^= sHandleHasher(*(uint64_t*)&id.body.guid.Data4[0]);
		return result;
	case ObjectIdKind::Positional:
		result = sHandleHasher(*(uint64_t*)&id.body.pos.x);
		result ^= sHandleHasher(*(uint64_t*)&id.body.pos.tempId);
		return result;
	case ObjectIdKind::Handle:
		return sHandleHasher(id.GetHandle());
	case ObjectIdKind::Blocked:
		return 0;
	}
}
 void operator()( argument_type i_arg ) const {
     long i = i_arg.get_value();
     if( (i&1)==0 && i+1<N ) {
         MinimalArgumentType value;
         value.set_value(i+1);
         my_while.add( value );
     }
     for( int j=0; j<n; ++j )    
         c[i][j] = 0;
     for( int k=0; k<n; ++k ) {
         Element aik = a[i][k];
         for( int j=0; j<n; ++j )    
             c[i][j] += aik*b[k][j];
     }
 }
Exemple #16
0
    result_type operator() (argument_type line)
    {
        // parse for our symbols
        for( std::string::size_type pos = 0; (pos = line.find('$', pos)) != std::string::npos; pos++ )
        {
            std::string::size_type end = line.find(')', pos);

            std::string::iterator it_begin = line.begin() + pos;
            std::string::iterator it_end = line.begin() + end;

            std::string statement = line.substr(pos + 2, end - pos - 2);

            // check for commands
            std::string::size_type space_pos;
            if( (space_pos = statement.find_first_of(" )", 0)) != std::string::npos )
            {
                // space must come first
                if( statement[space_pos] == ' ' )
                {
                    // push the parser for this command
                    std::string command = statement.substr(0, space_pos);
                    parsers.push_back(parser_factory(command, symbols, parsers, input, output));
                    parsers.back()->operator()(line);

                    return true;
                }
            }

            symbol_map::const_iterator sym = symbols.find(statement);
            if( sym == symbols.end() )
                throw std::runtime_error(std::string("Unknown symbol encountered: ") + statement);

            line.replace(pos, end - pos + 1, sym->second);

            pos++;
        }

        if( m_should_output )
            output << line << "\n";

        return true;
    }
Exemple #17
0
 result_type operator()(const argument_type& resourceProviderId) const
 {
   size_t seed = 0;
   boost::hash_combine(seed, resourceProviderId.value());
   return seed;
 }
Exemple #18
0
 result_type operator()(const argument_type& taskId) const
 {
   size_t seed = 0;
   boost::hash_combine(seed, taskId.value());
   return seed;
 }
Exemple #19
0
 std::size_t operator()(argument_type const& val)
 {
     return val.hash();
 }
 result_type operator()(const argument_type& a) const
 {
     return std::hash<std::string>()(a.id());
 }
Exemple #21
0
 result_type operator()(const argument_type& arg) const
 {
     return static_cast<result_type>((long)PyObject_Hash(arg.ptr()));
 }
	result_type operator()(argument_type pNdasLogicalUnit) const
	{
		HANDLE h;
		COMVERIFY(pNdasLogicalUnit->get_AlarmEvent(&h));
		return h;
	}
Exemple #23
0
 value_type operator()(argument_type const& value) const {
     value_type const h1(std::hash<std::string>()(value.address().to_string()));
     value_type const h2(std::hash<std::uint16_t>()(value.port()));
     return h1 ^ (h2 << 1);
 }
 result_type operator()( argument_type _test ){
      _test->SafeRun();
 }
	/**
	 * @param[in] m piranha::univariate_monomial whose hash value will be returned.
	 * 
	 * @return piranha::univariate_monomial::hash().
	 * 
	 * @throws unspecified any exception thrown by piranha::univariate_monomial::hash().
	 */
	result_type operator()(const argument_type &m) const noexcept(true)
	{
		return m.hash();
	}
Exemple #26
0
 result_type operator()(const argument_type &p){
   return result_type(p.x());
 }
Exemple #27
0
 result_type operator () (const argument_type op) const
 {
       return op->hash ();
 }
Exemple #28
0
 /**
  * @param a the piranha::array_key whose hash value will be returned.
  *
  * @return piranha::array_key::hash().
  */
 result_type operator()(const argument_type &a) const
 {
     return a.hash();
 }
Exemple #29
0
 result_type operator()(argument_type const& s) const noexcept
 {
     return s.Hash();
 }
Exemple #30
0
 result_type operator()(argument_type const& s) const { return s.std_hash(); }