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

Method writeDataNode

src/IECore/StreamIndexedIO.cpp:2146–2171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2144
2145template < typename F, typename D >
2146void StreamIndexedIO::Index::writeDataNode( D *node, F &f )
2147{
2148 NodeBase::NodeType nodeType = node->nodeType();
2149 f.write( (char *) &nodeType, sizeof( char ) );
2150
2151 uint64_t id = m_stringCache.find( node->name() );
2152 writeLittleEndian( f, id );
2153
2154 char t = node->dataType();
2155 f.write( &t, sizeof(char) );
2156
2157 if ( IndexedIO::Entry::isArray(node->dataType()) )
2158 {
2159 writeLittleEndian<F,uint64_t>( f, node->arrayLength() );
2160 }
2161
2162 writeLittleEndian(f, node->offset());
2163 writeLittleEndian<F,uint64_t>(f, node->size());
2164
2165 if ( node->nodeType() == NodeBase::Data )
2166 {
2167 writeLittleEndian<F, uint64_t>( f, node->decompressedSize() );
2168 writeLittleEndian<F, unsigned short>(f, node->compressedBlocks() );
2169 }
2170
2171}
2172
2173template < typename F >
2174void StreamIndexedIO::Index::writeNode( SubIndexNode *node, F &f )

Callers

nothing calls this directly

Calls 11

writeLittleEndianFunction · 0.85
nodeTypeMethod · 0.80
writeMethod · 0.45
findMethod · 0.45
nameMethod · 0.45
dataTypeMethod · 0.45
arrayLengthMethod · 0.45
offsetMethod · 0.45
sizeMethod · 0.45
decompressedSizeMethod · 0.45
compressedBlocksMethod · 0.45

Tested by

no test coverage detected