00001 #ifndef SDXNODECONTAINER_H 00002 #define SDXNODECONTAINER_H 00003 00004 #include <vector> 00005 #include <string> 00006 00007 namespace SDX { 00008 class ContentHandler; 00009 class Node; 00010 00014 class NodeContainer { 00015 public: 00019 NodeContainer(); 00020 00024 virtual ~NodeContainer(); 00025 00030 void setDeallocateContentOnDestruct(bool v); 00031 00036 NodeContainer& addChild(Node* node); 00037 00043 void removeChild(unsigned int index, bool deallocate = true); 00044 00048 void removeChild(Node* node, bool deallocate = true); 00049 00053 const std::vector<Node*> getChildren(); 00054 00058 const std::vector<Node*> getChildren(std::string nodeName); 00059 00063 Node* getChild(std::string nodeName); 00064 00068 Node* getChild(unsigned int index = 0); 00069 00073 Node* getChild(std::string nodeName, std::string attributeValue, std::string attributeName = ""); 00074 protected: 00078 bool m_deallocateContentOnDestruct; 00079 private: 00080 std::vector<Node*> m_children; 00081 }; 00082 } 00083 00084 #endif
1.5.8