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

Method writeNodeChildren

src/IECore/StreamIndexedIO.cpp:2185–2223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2183
2184template < typename F >
2185void StreamIndexedIO::Index::writeNodeChildren( DirectoryNode *n, F &f )
2186{
2187 uint32_t nodeCount = n->children().size();
2188 writeLittleEndian( f, nodeCount );
2189
2190 for (DirectoryNode::ChildMap::const_iterator it = n->children().begin(); it != n->children().end(); ++it)
2191 {
2192 NodeBase *p = *it;
2193 switch( p->nodeType() )
2194 {
2195 case NodeBase::Data :
2196 {
2197 DataNode *childNode = static_cast< DataNode *>(p);
2198 writeDataNode( childNode, f );
2199 break;
2200 }
2201 case NodeBase::SmallData :
2202 {
2203 SmallDataNode *childNode = static_cast< SmallDataNode * >(p);
2204 writeDataNode( childNode, f );
2205 break;
2206 }
2207 case NodeBase::Directory :
2208 {
2209 DirectoryNode *childNode = static_cast< DirectoryNode *>(p);
2210 writeNode( childNode, f );
2211 break;
2212 }
2213 case NodeBase::SubIndex :
2214 {
2215 SubIndexNode *childNode = static_cast< SubIndexNode *>(p);
2216 writeNode( childNode, f );
2217 break;
2218 }
2219 default:
2220 throw Exception( "Invalid node type!" );
2221 }
2222 }
2223}
2224
2225template < typename F >
2226void StreamIndexedIO::Index::writeNode( DirectoryNode *node, F &f )

Callers

nothing calls this directly

Calls 5

writeLittleEndianFunction · 0.85
nodeTypeMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected