UserNodeC.cpp
#include "UserNodeC.h" #include "UserNodeC2.h" #include <CDPSystem/Base/CDPBaseObject.h> using namespace CDP::StudioAPI; using namespace CDP::System::Base; using namespace UserDefinedStructureLib; /*! \class UserNodeC \inmodule UserDefinedStructureLib \section1 Usage Add documentation for UserNodeC here. */ UserNodeC::UserNodeC(XMLElementEx* element, CDPBaseObject* owner) { SetNodeOwner(owner); PropertyCreate(nodeName, this, "Name", e_PropertySaveOnChange, element); PropertyCreate(userAttribute, this, "UserAttribute", e_PropertySaveOnChange, element); CreateUserNodesC2(element); } UserNodeC::~UserNodeC() { for (auto node: m_userNodesC2) delete node; } void UserNodeC::CreateUserNodesC2(XMLElementEx *pEx) { XMLElementEx* xmlUserNodesC2 = nullptr; if (pEx->GetChildElement("UserNodesC2", xmlUserNodesC2)) { XMLElementEx* xmlUserNodeC2 = xmlUserNodesC2->GetChild(); while (xmlUserNodeC2) { m_userNodesC2.push_back(new UserNodeC2(xmlUserNodeC2, this)); xmlUserNodeC2 = xmlUserNodeC2->GetNext(); } } } const std::string UserNodeC::GetNodeName() const { return nodeName; } std::string UserNodeC::GetNodeTypeName() const { return "UserDefinedStructureLib.UserNodeC"; } void UserNodeC::FillNodeChildren(CDP::StudioAPI::NodeStream &serializer) const { serializer << AdoptedChild(nodeName) << AdoptedChild(userAttribute); serializer.StdContainerStreamer(m_userNodesC2); }
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.