00001 /*************************************************************************** 00002 * 00003 * Copyright (c) 2007-2010 Argo SE, Inc. All rights reserved. 00004 * 00005 * The following source code, and the ideas, expressions and concepts 00006 * incorporated therein, as well as the ideas, expressions and concepts of 00007 * any other material (whether tangible or intangible) disclosed in 00008 * conjunction with this source code, are the exclusive and proprietary 00009 * property, and constitutes confidential information, of Argo SE, Inc. 00010 * Accordingly, the user of this source code 00011 * agrees that it shall continue to be bound by the terms and conditions of 00012 * any and all confidentiality agreements executed with Argo SE, Inc. 00013 * concerning the disclosure of the source code and any other materials in 00014 * conjunction therewith. 00015 * 00016 */ 00017 00018 #pragma once 00019 00020 #include <string> 00021 #include <map> 00022 #include <list> 00023 00024 namespace RT 00025 { 00026 00027 00028 enum RTNodeType 00029 { 00030 nt_Unknown, 00031 nt_String, 00032 nt_Char, 00033 nt_Int, 00034 nt_UtcTimeStamp, 00035 nt_Boolean, 00036 nt_Double, 00037 }; 00038 00039 // forward declaration 00040 class RTNode; 00041 00047 class RTNodeList 00048 { 00049 public: 00051 virtual RTNode * item (size_t index) const =0; 00053 virtual size_t getLength () const =0; 00054 00055 protected: 00057 RTNodeList(){} 00059 virtual ~RTNodeList (){} 00060 }; 00061 00067 class RTNamedNodeMap 00068 { 00069 public: 00071 virtual RTNode * setNamedItem (RTNode *arg)=0; 00073 virtual RTNode * item (size_t index) const =0; 00075 virtual RTNode * getNamedItem (const char *name) const =0; 00077 virtual size_t getLength () const =0; 00079 virtual RTNode * removeNamedItem (const char *name)=0; 00080 00081 protected: 00083 RTNamedNodeMap(){} 00085 virtual ~RTNamedNodeMap (){} 00086 }; 00087 00088 struct RTNodeException 00089 { 00090 virtual const char* what() const= 0; 00091 }; 00092 00099 class RTNode /*: public IRTNameValue*/ 00100 { 00101 public: 00102 00104 virtual const char * name () const =0; 00106 virtual const char * value () const =0; 00108 virtual RTNodeType type () const =0; 00110 virtual RTNode * parent () const =0; 00112 virtual RTNodeList * child_list () const =0; 00114 virtual RTNode * first_child () const =0; 00116 virtual RTNode * next_sibling () const =0; 00118 virtual RTNamedNodeMap* attributes () =0; 00119 00120 // Gets Node identifier (int ID of the node from template config) 00121 virtual int identifier() const =0; 00122 // Returns true if node can be cloned and false otherwise 00123 virtual bool cloneable () const =0; 00124 00125 00129 virtual RTNode * clone () const =0; 00131 virtual RTNode * remove_child (RTNode *oldChild)=0; 00133 virtual bool has_child_nodes () const =0; 00134 00136 virtual void value (const char *nodeValue)=0; 00137 00139 virtual void value(int)=0; 00141 virtual void value(double)=0; 00143 virtual void value(bool)=0; 00145 virtual void value(char)=0; 00147 virtual void value(time_t)=0; 00148 00152 virtual void release()=0; 00153 00154 00155 protected: 00157 RTNode (){} 00159 RTNode (const RTNode &){} 00161 virtual ~RTNode (){} 00162 }; 00163 00164 }