DiaDes  0.1
DIAgnosis of Discrete-Event System
XmlTag.hh
Go to the documentation of this file.
1 #ifndef __DIADES__AUTOMATA__XMLTAG__HH__
2 #define __DIADES__AUTOMATA__XMLTAG__HH__
3 
4 #include<sstream>
5 #include<string>
6 #include<map>
7 #include"boost/date_time/posix_time/posix_time.hpp"
8 #include<automata/Event.hh>
9 
10 using std::string;
11 using std::pair;
12 using namespace boost::posix_time;
13 
14 namespace Diades
15 {
16  namespace Automata
17  {
18 
19 
20  /***********************************************************************************/
21 
22  inline string tinyXmlTag(const time_duration & t)
23  {
24  return "TimePoint";
25  }
26 
27 
28  /***********************************************************************************/
29 
30  inline string tinyXmlTag(const Event & e)
31  {
32  return "EventLabel";
33  }
34 
35  /***********************************************************************************/
36 
37  inline string tinyXmlTag(const pair<time_duration,Event> & p)
38  {
39  return "Event";
40  }
41 
42 
43  /***********************************************************************************/
44 
45  inline string tinyXmlText(const time_duration & t)
46  {
47  std::stringstream stream;
48  stream << t.total_seconds();
49  return stream.str();
50  }
51 
52 
53 
54  /***********************************************************************************/
55 
56  inline string tinyXmlText(const Event & e)
57  {
58  return e.label();
59  }
60 
61 
62  };
63 
64 };
65 
66 #endif
const Label & label() const
string tinyXmlText(const Event &e)
Definition: XmlTag.hh:56
string tinyXmlTag(const pair< time_duration, Event > &p)
Definition: XmlTag.hh:37
Namespace of the Diades project.