I'm not sure which design decision would be best - Idea 2 and Idea 3 seem pretty much the same, with the small difference that Idea 2 would make this message usable from other places as well. If you would need the functionality only in Parent
, then I suppose Idea 3 would be most "encapsulating".
And for you SDK query about the data cast - this should do the trick. Usually when doing such node data queries, you should always check the type with GetType()
, but since you create the object on the line above, the check would be redundant.
BaseObject* child = BaseObject::Alloc(Ochild);
if (child) {
Child* castedChild = child->GetNodeData<Child>();
castedChild->CreateNulls(childNullsCount, childNullsShape);
}