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

Method registerChild

src/IECore/StreamIndexedIO.cpp:1237–1265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235///////////////////////////////////////////////
1236
1237void DirectoryNode::registerChild( NodeBase* c )
1238{
1239 if ( !c )
1240 {
1241 throw Exception("Invalid pointer for child node!!");
1242 }
1243
1244 if ( m_children.size() >= UINT32_MAX )
1245 {
1246 // we currently save childCount as a uint32... so we prevent new children by construction.
1247 throw IOException("StreamIndexedIO: Too many children under the same node!");
1248 }
1249
1250 if ( c->nodeType() == NodeBase::Directory )
1251 {
1252 DirectoryNode *childNode = static_cast< DirectoryNode *>(c);
1253 if (childNode->m_parent)
1254 {
1255 throw IOException("StreamIndexedIO: Node already has parent!");
1256 }
1257 childNode->m_parent = this;
1258 }
1259 else if ( c->nodeType() == NodeBase::SubIndex )
1260 {
1261 m_subindexChildren = true;
1262 }
1263 m_children.push_back( c );
1264 m_sortedChildren = false;
1265}
1266
1267void DirectoryNode::path( IndexedIO::EntryIDList &result ) const
1268{

Callers 6

addChildMethod · 0.80
addDataChildMethod · 0.80
readNodeV4Method · 0.80
readNodeV5Method · 0.80
readNodeMethod · 0.80
readNodeFromSubIndexMethod · 0.80

Calls 3

IOExceptionFunction · 0.85
nodeTypeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected