MCPcopy Create free account
hub / github.com/ImageEngine/cortex / rawRead

Method rawRead

src/IECore/StreamIndexedIO.cpp:3349–3378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3347
3348template<typename T>
3349void StreamIndexedIO::rawRead(const IndexedIO::EntryID &name, T *&x, size_t arrayLength) const
3350{
3351 assert( m_node );
3352 readable(name);
3353
3354 StreamIndexedIO::Node::Info nodeInfo;
3355 if( !m_node->dataChildInfo( name, nodeInfo ) )
3356 {
3357 throw IOException( "StreamIndexedIO::rawRead: Data entry not found '" + name.value() + "'" );
3358 }
3359
3360 if (!x)
3361 {
3362 x = new T[arrayLength];
3363 }
3364
3365 size_t arraySizeInBytes = sizeof(T) * arrayLength;
3366 if ( arraySizeInBytes != nodeInfo.decompressedSize )
3367 {
3368 throw IECore::IOException(
3369 boost::str(
3370 boost::format( "StreamIndexedIO::rawRead - array size (%1%) does not match block size (%2%) " ) %
3371 arraySizeInBytes %
3372 nodeInfo.decompressedSize
3373 )
3374 );
3375 }
3376
3377 Reader reader( streamFile(), nodeInfo, m_node->m_idx->decompressionThreadCount(), reinterpret_cast<char *>( x ) );
3378}
3379
3380template<typename T>
3381void StreamIndexedIO::read(const IndexedIO::EntryID &name, T &x) const

Callers

nothing calls this directly

Calls 6

IOExceptionFunction · 0.85
dataChildInfoMethod · 0.80
strFunction · 0.50
valueMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected