PCMOutputNode.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00027
00028 #ifndef __PCM_OUTPUTNODE_H__
00029 # define __PCM_OUTPUTNODE_H__
00030
00031
00032
00033
00034
00035 # include "PCMPremeditations.h"
00036
00037 # include "PCMName.h"
00038
00039 # include "PCMStringConverter.h"
00040
00041
00042
00043
00044
00045 # include <string>
00046
00047 # include <sstream>
00048
00049 # include <list>
00050
00051 # include <map>
00052
00053 # include <algorithm>
00054
00055 namespace ParCompMark
00056 {
00057
00062 class OutputNode:public Name
00063 {
00064
00065
00066
00067
00068 # ifdef PARCOMPMARK_TEST
00069 friend class ParCompMarkTest::TestOutputNode;
00070 # endif
00071
00072
00073
00074
00075
00076 public:
00077
00079 enum NodeType
00080 {
00081
00083 DEFINITION,
00084
00086 INFORMATION,
00087
00089 REFERENCE,
00090
00092 STATISTICS,
00093
00095 TEXT,
00096
00098 CDATA
00099 };
00100
00101
00102
00103
00104
00105 public:
00106
00108 typedef Pointer < OutputNode,
00109 Mutex > Pointer;
00110
00112 typedef std::list < OutputNode::Pointer > ChildNodeList;
00113
00115 typedef ChildNodeList::iterator ChildNodeListIterator;
00116
00118 typedef std::map < std::string,
00119 std::string > AttributeMap;
00120
00122 typedef AttributeMap::const_iterator AttributeMapIterator;
00123
00124
00125
00126
00127
00129
00130
00131 protected:
00132
00138 static const std::string TEXTNODENAME;
00139
00141
00142
00143
00144
00145
00147
00148
00149 protected:
00150
00156 NodeType mType;
00157
00163 AttributeMap mAttributes;
00164
00170 ChildNodeList mChildren;
00171
00177 std::string mText;
00178
00180
00181
00182
00183
00184
00186
00187
00188 public:
00189
00195 OutputNode(const std::string & name, const NodeType & type);
00196
00201 OutputNode(const std::string & text);
00202
00206 virtual ~ OutputNode();
00207
00209
00210
00211
00212
00213
00215
00216
00217 public:
00218
00224 static const std::string & getEXTNODENAME();
00225
00231 const OutputNode::NodeType & getType() const;
00232
00238 const std::string & getText() const;
00239
00245 void setText(const std::string & text);
00246
00248
00249
00250
00251
00252
00254
00255
00256 public:
00257
00263 static OutputNode::Pointer parseFromXML(std::string & xmlDocument);
00264
00265 protected:
00266
00272 static bool _testXMLName(const std::string & name);
00273
00279 static std::string _convertSpecialChars(const std::string & string);
00280
00282
00283
00284
00285
00286
00288
00289
00290 public:
00291
00298 virtual OutputNode::Pointer createChildNode(const std::string & name, const NodeType & type);
00299
00305 virtual OutputNode::Pointer createChildNode(const std::string & text);
00306
00311 virtual void addChildNode(OutputNode::Pointer child);
00312
00317 virtual u32 getChildCount();
00318
00323 virtual OutputNode::Pointer getFirstChildNode();
00324
00330 virtual bool hasAttribute(const std::string & attribute) const;
00331
00337 virtual const std::string & getAttribute(const std::string & attribute) const;
00338
00344 virtual void setAttribute(const std::string & attribute, const std::string & value);
00345
00351 virtual std::ostringstream & serialize2XML(std::ostringstream & osstr);
00352
00357 virtual std::string serialize2XML();
00358
00362 virtual void refreshData();
00363
00367 virtual void clean();
00368
00370
00371 };
00372
00373
00374
00375
00376
00377 # include "PCMOutputNode_impl.h"
00378
00379 }
00380
00381 #endif