当前位置: 首页>>代码示例>>C++>>正文


C++ MurmurHash::append方法代码示例

本文整理汇总了C++中MurmurHash::append方法的典型用法代码示例。如果您正苦于以下问题:C++ MurmurHash::append方法的具体用法?C++ MurmurHash::append怎么用?C++ MurmurHash::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MurmurHash的用法示例。


在下文中一共展示了MurmurHash::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cookMySop

OP_ERROR SOP_SceneCacheSource::cookMySop( OP_Context &context )
{
	flags().setTimeDep( true );
	
	std::string file;
	if ( !ensureFile( file ) )
	{
		addError( SOP_ATTRIBUTE_INVALID, ( file + " is not a valid .scc" ).c_str() );
		gdp->clearAndDestroy();
		return error();
	}
	
	std::string path = getPath();
	Space space = getSpace();
	
	UT_String shapeFilterStr;
	evalString( shapeFilterStr, pShapeFilter.getToken(), 0, 0 );
	UT_StringMMPattern shapeFilter;
	shapeFilter.compile( shapeFilterStr );
	
	UT_String p( "P" );
	UT_String attributeFilter;
	evalString( attributeFilter, pAttributeFilter.getToken(), 0, 0 );
	if ( !p.match( attributeFilter ) )
	{
		attributeFilter += " P";
	}
	
	ConstSceneInterfacePtr scene = this->scene( file, path );
	if ( !scene )
	{
		addError( SOP_ATTRIBUTE_INVALID, ( path + " is not a valid location in " + file ).c_str() );
		gdp->clearAndDestroy();
		return error();
	}
	
	MurmurHash hash;
	hash.append( file );
	hash.append( path );
	hash.append( space );
	hash.append( shapeFilterStr );
	hash.append( attributeFilter );
	
	if ( !m_loaded || m_hash != hash )
	{
		gdp->clearAndDestroy();
	}
	
	Imath::M44d transform = ( space == World ) ? worldTransform( file, path, context.getTime() ) : Imath::M44d();
	
	SceneInterface::Path rootPath;
	scene->path( rootPath );
	
	loadObjects( scene, transform, context.getTime(), space, shapeFilter, attributeFilter.toStdString(), rootPath.size() );
	
	m_loaded = true;
	m_hash = hash;
	
	return error();
}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:60,代码来源:SOP_SceneCacheSource.cpp

示例2: batchHash

IECore::MurmurHash Dispatcher::batchHash( const ExecutableNode::Task &task )
{
	MurmurHash result;
	result.append( (uint64_t)task.node() );

	if ( task.hash() == MurmurHash() )
	{
		return result;
	}

	const Context *context = task.context();
	std::vector<IECore::InternedString> names;
	context->names( names );
	for ( std::vector<IECore::InternedString>::const_iterator it = names.begin(); it != names.end(); ++it )
	{
		// ignore the frame and the ui values
		if ( ( *it != g_frame ) && it->string().compare( 0, 3, "ui:" ) )
		{
			result.append( *it );
			if ( const IECore::Data *data = context->get<const IECore::Data>( *it ) )
			{
				data->hash( result );
			}
		}
	}

	return result;
}
开发者ID:CRiant,项目名称:gaffer,代码行数:28,代码来源:Dispatcher.cpp

示例3: imageHash

IECore::MurmurHash ImagePlug::imageHash() const
{
    const Box2i dataWindow = dataWindowPlug()->getValue();
    ConstStringVectorDataPtr channelNamesData = channelNamesPlug()->getValue();
    const vector<string> &channelNames = channelNamesData->readable();

    MurmurHash result = formatPlug()->hash();
    result.append( dataWindowPlug()->hash() );
    result.append( metadataPlug()->hash() );
    result.append( channelNamesPlug()->hash() );

    V2i minTileOrigin = tileOrigin( dataWindow.min );
    V2i maxTileOrigin = tileOrigin( dataWindow.max );

    ContextPtr context = new Context( *Context::current(), Context::Borrowed );
    Context::Scope scope( context.get() );

    for( vector<string>::const_iterator it = channelNames.begin(), eIt = channelNames.end(); it!=eIt; it++ )
    {
        context->set( ImagePlug::channelNameContextName, *it );
        for( int tileOriginY = minTileOrigin.y; tileOriginY<=maxTileOrigin.y; tileOriginY += tileSize() )
        {
            for( int tileOriginX = minTileOrigin.x; tileOriginX<=maxTileOrigin.x; tileOriginX += tileSize() )
            {
                context->set( ImagePlug::tileOriginContextName, V2i( tileOriginX, tileOriginY ) );
                channelDataPlug()->hash( result );
            }
        }
    }

    return result;
}
开发者ID:CRiant,项目名称:gaffer,代码行数:32,代码来源:ImagePlug.cpp

示例4: imageHash

IECore::MurmurHash ImagePlug::imageHash() const
{
	const Box2i dataWindow = dataWindowPlug()->getValue();
	ConstStringVectorDataPtr channelNamesData = channelNamesPlug()->getValue();
	const vector<string> &channelNames = channelNamesData->readable();

	MurmurHash result = formatPlug()->hash();
	result.append( dataWindowPlug()->hash() );
	result.append( metadataPlug()->hash() );
	result.append( channelNamesPlug()->hash() );

	ImageAlgo::parallelGatherTiles(
		this, channelNames,
		// Tile
		[] ( const ImagePlug *imagePlug, const string &channelName, const V2i &tileOrigin )
		{
			return imagePlug->channelDataPlug()->hash();
		},
		// Gather
		[ &result ] ( const ImagePlug *imagePlug, const string &channelName, const V2i &tileOrigin, const IECore::MurmurHash &tileHash )
		{
			result.append( tileHash );
		},
		dataWindow,
		ImageAlgo::BottomToTop
	);

	return result;
}
开发者ID:ImageEngine,项目名称:gaffer,代码行数:29,代码来源:ImagePlug.cpp

示例5: readable

	void SimpleDataHolder<Format>::hash( MurmurHash &h ) const
	{
		Format f = readable();
		h.append( f.getDisplayWindow().min );
		h.append( f.getDisplayWindow().max );
		h.append( f.getPixelAspect() );
	}
开发者ID:AntiCG,项目名称:gaffer,代码行数:7,代码来源:Format.cpp

示例6: sizeof

MurmurHash ExecutableNode::Task::hash() const
{
	MurmurHash h;
	const Node *nodePtr = node.get();
	h.append( (const char *)nodePtr, sizeof(Node*) );
	h.append( context->hash() );
	return h;
}
开发者ID:davidsminor,项目名称:gaffer,代码行数:8,代码来源:ExecutableNode.cpp

示例7: hash

void Display::hash( MurmurHash &h ) const
{
	PreWorldRenderable::hash( h );
	h.append( m_name );
	h.append( m_type );
	h.append( m_data );
	m_parameters->hash( h );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:8,代码来源:Display.cpp

示例8: topologyHash

void CurvesPrimitive::topologyHash( MurmurHash &h ) const
{
	h.append( m_basis.matrix );
	h.append( m_basis.step );
	h.append( m_linear );
	h.append( m_periodic );
	m_vertsPerCurve->hash( h );
}
开发者ID:ImageEngine,项目名称:cortex,代码行数:8,代码来源:CurvesPrimitive.cpp

示例9: hash

void MatrixMotionTransform::hash( MurmurHash &h ) const
{
	Transform::hash( h );
	for( SnapshotMap::const_iterator it=m_snapshots.begin(); it!=m_snapshots.end(); it++ )
	{
		h.append( it->first );
		h.append( it->second );
	}
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:9,代码来源:MatrixMotionTransform.cpp

示例10: batchHash

		// Hash used to determine how to coalesce tasks into batches.
		// If `batchHash( task1 ) == batchHash( task2 )` then the two
		// tasks can be placed in the same batch.
		IECore::MurmurHash batchHash( const TaskNode::Task &task )
		{
			MurmurHash result;
			result.append( (uint64_t)task.node() );
			// We ignore the frame because the whole point of batching
			// is to allow multiple frames to be placed in the same
			// batch if the context is otherwise identical.
			result.append( contextHash( task.context(), /* ignoreFrame = */ true ) );
			return result;
		}
开发者ID:appleseedhq,项目名称:gaffer,代码行数:13,代码来源:Dispatcher.cpp

示例11:

MurmurHash Renderer::ExternalProcedural::hash() const
{
	MurmurHash h;
	h.append( m_fileName );
	for( CompoundDataMap::const_iterator it = m_parameters.begin(), eIt = m_parameters.end(); it != eIt; ++it )
	{
		h.append( it->first );
		it->second->hash( h );
	}
	return h;
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:11,代码来源:Renderer.cpp

示例12: topologyHash

void NURBSPrimitive::topologyHash( MurmurHash &h ) const
{
	h.append( m_uOrder );
	m_uKnot->hash( h );
	h.append( m_uMin );
	h.append( m_uMax );
	h.append( m_vOrder );
	m_vKnot->hash( h );
	h.append( m_vMin );
	h.append( m_vMax );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:11,代码来源:NURBSPrimitive.cpp

示例13: hash

void Primitive::hash( MurmurHash &h ) const
{
    VisibleRenderable::hash( h );
    for( PrimitiveVariableMap::const_iterator it=variables.begin(); it!=variables.end(); it++ )
    {
        h.append( it->first );
        h.append( it->second.interpolation );
        it->second.data->hash( h );
    }

    topologyHash( h );
}
开发者ID:johnhaddon,项目名称:cortex,代码行数:12,代码来源:Primitive.cpp

示例14: Exception

void SimpleDataHolder<CompoundDataMap>::hash( MurmurHash &h ) const
{
	// the CompoundDataMap is sorted by InternedString::operator <,
	// which just compares addresses of the underlying interned object.
	// this isn't stable between multiple processes.
	const CompoundDataMap &m = readable();
	std::vector<CompoundDataMap::const_iterator> iterators;
	iterators.reserve( m.size() );
	for( CompoundDataMap::const_iterator it=m.begin(); it!=m.end(); it++ )
	{
		iterators.push_back( it );
	}

	// so we have to sort again based on the string values
	// themselves.
	sort( iterators.begin(), iterators.end(), comp );

	// and then hash everything in the stable order.
	std::vector<CompoundDataMap::const_iterator>::const_iterator it;
	for( it=iterators.begin(); it!=iterators.end(); it++ )
	{
		if ( !((*it)->second) )
		{
			throw Exception( "Cannot compute hash from a CompoundData will NULL data pointers!" );
		}

		h.append( (*it)->first.value() );
		(*it)->second->hash( h );
	}
}
开发者ID:ImageEngine,项目名称:cortex,代码行数:30,代码来源:CompoundDataBase.cpp

示例15: hash

void Shader::hash( MurmurHash &h ) const
{
	StateRenderable::hash( h );
	h.append( m_name );
	h.append( m_type );
	m_parameters->hash( h );
}
开发者ID:AtomicFiction,项目名称:cortex,代码行数:7,代码来源:Shader.cpp


注:本文中的MurmurHash::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。