本文整理汇总了C++中MurmurHash类的典型用法代码示例。如果您正苦于以下问题:C++ MurmurHash类的具体用法?C++ MurmurHash怎么用?C++ MurmurHash使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MurmurHash类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hashFn
static MurmurHash hashFn( const ComputeParameters ¶ms )
{
const std::string &filePath = params.first;
MurmurHash h;
h.append( filePath );
return h;
}
示例2: flags
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();
}
示例3: hash
static MurmurHash hash( const ComputationParams ¶ms )
{
int id = params;
MurmurHash h;
h.append(id);
return h;
}
示例4: 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;
}
示例5: dataWindowPlug
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;
}
示例6: dataWindowPlug
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;
}
示例7: 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() );
}
示例8: 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;
}
示例9: 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 );
}
示例10: 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 );
}
示例11: 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 );
}
}
示例12: 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;
}
示例13:
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;
}
示例14: 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 );
}
示例15: 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 );
}