XdmfTime.hpp 4.09 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfTime.hpp                                                        */
/*                                                                           */
/*  Author:                                                                  */
/*     Kenneth Leiter                                                        */
/*     kenneth.leiter@arl.army.mil                                           */
/*     US Army Research Laboratory                                           */
/*     Aberdeen Proving Ground, MD                                           */
/*                                                                           */
/*     Copyright @ 2011 US Army Research Laboratory                          */
/*     All Rights Reserved                                                   */
/*     See Copyright.txt for details                                         */
/*                                                                           */
/*     This software is distributed WITHOUT ANY WARRANTY; without            */
/*     even the implied warranty of MERCHANTABILITY or FITNESS               */
/*     FOR A PARTICULAR PURPOSE.  See the above copyright notice             */
/*     for more information.                                                 */
/*                                                                           */
/*****************************************************************************/

24
25
26
27
#ifndef XDMFTIME_HPP_
#define XDMFTIME_HPP_

// Includes
28
#include "Xdmf.hpp"
29
30
31
#include "XdmfItem.hpp"

/**
32
 * @brief Time specification for an XdmfGrid.
33
 *
34
 * An XdmfTime sets a time value for an XdmfGrid.
35
 */
36
class XDMF_EXPORT XdmfTime : public XdmfItem {
37

38
public:
39

40
41
42
  /**
   * Create a new XdmfTime.
   *
43
44
45
46
   * Example of use:
   *
   * C++
   *
47
   * @dontinclude ExampleXdmfTime.cpp
48
49
   * @skipline //#initialization
   * @until //#initialization
50
51
52
   *
   * Python
   *
53
   * @dontinclude XdmfExampleTime.py
54
55
   * @skipline #//initialization
   * @until #//initialization
56
   *
57
58
   * @param 	value 	The timeValue of the XdmfTime to create.
   * @return 		The new XdmfTime.
59
   */
60
  static shared_ptr<XdmfTime> New(const double & value = 0);
61

62
  virtual ~XdmfTime();
63

64
65
  LOKI_DEFINE_VISITABLE(XdmfTime, XdmfItem);
  static const std::string ItemTag;
66

67
  std::map<std::string, std::string> getItemProperties() const;
68

69
  std::string getItemTag() const;
70

71
72
73
  /**
   * Get the time value associated with this XdmfTime.
   *
74
75
76
77
   * Example of use:
   *
   * C++
   *
78
   * @dontinclude ExampleXdmfTime.cpp
79
80
81
82
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#getValue
   * @until //#getValue
83
84
85
   *
   * Python
   *
86
   * @dontinclude XdmfExampleTime.py
87
88
89
90
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//getValue
   * @until #//getValue
91
   *
92
   * @return 	A double containing the time value.
93
94
   */
  double getValue() const;
95

96
97
98
  /**
   * Set the time value associated with this XdmfTime.
   *
99
100
101
102
   * Example of use:
   *
   * C++
   *
103
   * @dontinclude ExampleXdmfTime.cpp
104
105
106
107
   * @skipline //#initialization
   * @until //#initialization
   * @skipline //#setValue
   * @until //#setValue
108
109
110
   *
   * Python
   *
111
   * @dontinclude XdmfExampleTime.py
112
113
114
115
   * @skipline #//initialization
   * @until #//initialization
   * @skipline #//setValue
   * @until #//setValue
116
   *
117
   * @param 	time 	A double containing the time value.
118
119
   */
  void setValue(const double & time);
120

121
protected:
122

123
  XdmfTime(const double & value);
124

125
126
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
127
               const std::vector<shared_ptr<XdmfItem> > & childItems,
128
               const XdmfCoreReader * const reader);
129

130
private:
131

132
133
134
135
  XdmfTime(const XdmfTime &);  // Not implemented.
  void operator=(const XdmfTime &);  // Not implemented.

  double mValue;
136
137
138
};

#endif /* XDMFTIME_HPP_ */