DROP_IF(infoBlockPtr==NULL,"Failed to find block named '"+theEntry+"' while fixing up children of block: "+_Name, ++errors;continue);
DROP_IF(infoBlockPtr==NULL,"Failed to find block named '"+theEntry+"' while fixing up children of block: "+_Name.c_str(), ++errors;continue);
// make sure that this block doesn't figure amongst the children of the refferenced info block (to avoid circular refs)
DROP_IF(_haveCircularRef(infoBlockPtr),"Circular dependency found between definitions of '"+_Name+"' and '"+theEntry+"'",++errors;continue);
DROP_IF(_haveCircularRef(infoBlockPtr),"Circular dependency found between definitions of '"+_Name+"' and '"+theEntry.c_str()+"'",++errors;continue);
// add the info block to our children
_Children.push_back(infoBlockPtr);
@ -431,7 +431,7 @@ namespace DEPCFG
DROP_IF(!_ShardName.empty()&&!theExe.ShardName.empty(),"more than one shard found in: "+theExe.FullName,++errors);
DROP_IF(!_CmdLine.empty()&&!theExe.CmdLine.empty(),"more than one cmdLine found in: "+theExe.FullName,++errors);
DROP_IF(!_Host.empty()&&!theExe.Host.empty(),"more than one host found in: "+theExe.FullName,++errors);
WARN_IF(!_UniqueName.empty()&&!theExe.UniqueName.empty(),"replacing name '"+theExe.UniqueName+"' with '"+_UniqueName+"' in: "+theExe.FullName);
WARN_IF(!_UniqueName.empty()&&!theExe.UniqueName.empty(),"replacing name '"+theExe.UniqueName+"' with '"+_UniqueName.c_str()+"' in: "+theExe.FullName.c_str());
// yell if the name already looks like a 'fixed up' name
DROP_IF(name.right(3).left(1)=="_"&&(name.right(2)=="00"||name.right(2).atoui()!=0),"Appending '_' to name ending in '_00' style format as this can clash with auto renumbering => "+name+'_',name+='_')
// compose a second version of the name with the shard name added
BOMB_IF(parent!=NULL&&idx>1024*1024,"Implausibly high number of children requested ("+NLMISC::toString("%d",idx)+") for persistent data tree node: "+parent->getNodeName(),returnfalse);
BOMB_IF(parent!=NULL&&idx>1024*1024,"Implausibly high number of children requested ("+NLMISC::toString("%d",idx)+") for persistent data tree node: "+parent->getNodeName().c_str(),returnfalse);
// check for attachment to previous parent
BOMB_IF(_Parent!=NULL,"Attempting to attach a persistent data node to parent '"+(parent==NULL?"NULL":parent->getNodeName())+"' when it's already attached to another parent as: "+getNodeName(),returnfalse);
BOMB_IF(_Parent!=NULL,"Attempting to attach a persistent data node to parent '"+(parent==NULL?"NULL":parent->getNodeName())+"' when it's already attached to another parent as: "+getNodeName().c_str(),returnfalse);
BOMB_IF(parent->_IsValue,"Attempting to attach a persistent data node to parent that has a value '"+parent->getNodeName()+"' = "+parent->_Value,returnfalse);
BOMB_IF(parent->_IsValue,"Attempting to attach a persistent data node to parent that has a value '"+parent->getNodeName()+"' = "+parent->_Value.c_str(),returnfalse);
// ensure that there isn't already a node with the same '#' value attached to the same parent
DROP_IF(parent->_ChildIndex.find(nameBase+'#'+mapIndex)!=parent->_ChildIndex.end(),"Failed to add child '"+_Name+"' to parent '"+parent->getNodeName()+"' because another child of same name already exists",returnfalse);
DROP_IF(parent->_ChildIndex.find(nameBase+'#'+mapIndex.c_str())!=parent->_ChildIndex.end(),"Failed to add child '"+_Name+"' to parent '"+parent->getNodeName().c_str()+"' because another child of same name already exists",returnfalse);
// ensure that there isn't another child already assigned to this parent slot
BOMB_IF(_Parent->_Children[idx]!=NULL,"Ignoring attempt to add second child to same slot ("+NLMISC::toString("%d",idx)+") in persistent data tree node's children: "+_Parent->getNodeName(),returnfalse);
BOMB_IF(_Parent->_Children[idx]!=NULL,"Ignoring attempt to add second child to same slot ("+NLMISC::toString("%d",idx)+") in persistent data tree node's children: "+_Parent->getNodeName().c_str(),returnfalse);
// write own pointer into parent's _Children vector
// extract the map key and ensure that it's followed by a valid __Val__ entry
CSStringmapKey;
pdr.pop(mapKeyToken,mapKey);
DROP_IF(pdr.isEndOfData()||pdr.peekNextToken()!=mapValToken,"ERROR: Ignoring map key (__Key__) because __Val__ token expected but not found at: "+getNodeName()+":"+mapKey,continue);
DROP_IF(pdr.isEndOfData()||pdr.peekNextToken()!=mapValToken,"ERROR: Ignoring map key (__Key__) because __Val__ token expected but not found at: "+getNodeName()+":"+mapKey.c_str(),continue);
DROP_IF(_IsValue,"ERROR: Failed to flag persistent data tree node '"+getNodeName()+"' as a map as it already has a value: "+_Value,returnfalse);
DROP_IF(_IsValue,"ERROR: Failed to flag persistent data tree node '"+getNodeName()+"' as a map as it already has a value: "+_Value.c_str(),returnfalse);