XdmfTime.hpp 1.39 KB
Newer Older
1
2
3
4
#ifndef XDMFTIME_HPP_
#define XDMFTIME_HPP_

// Includes
5
#include "Xdmf.hpp"
6
7
8
#include "XdmfItem.hpp"

/**
9
 * @brief Time specification for an XdmfGrid.
10
 *
11
 * An XdmfTime sets a time value for an XdmfGrid.
12
 */
13
class XDMF_EXPORT XdmfTime : public XdmfItem {
14

15
 public:
16

17
18
19
20
21
22
23
  /**
   * Create a new XdmfTime.
   *
   * @param value the timeValue of the XdmfTime to create.
   * @return the new XdmfTime.
   */
  static boost::shared_ptr<XdmfTime> New(const double & value = 0);
24

25
  virtual ~XdmfTime();
26

27
28
  LOKI_DEFINE_VISITABLE(XdmfTime, XdmfItem);
  static const std::string ItemTag;
29

30
  std::map<std::string, std::string> getItemProperties() const;
31

32
  std::string getItemTag() const;
33

34
35
36
37
38
39
  /**
   * Get the time value associated with this XdmfTime.
   *
   * @return a double containing the time value.
   */
  double getValue() const;
40

41
42
43
44
45
46
  /**
   * Set the time value associated with this XdmfTime.
   *
   * @param time a double containing the time value.
   */
  void setValue(const double & time);
47

48
 protected:
49

50
  XdmfTime(const double & value);
51

52
53
54
55
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
               std::vector<boost::shared_ptr<XdmfItem> > & childItems,
               const XdmfCoreReader * const reader);
56

57
 private:
58

59
60
61
62
  XdmfTime(const XdmfTime &);  // Not implemented.
  void operator=(const XdmfTime &);  // Not implemented.

  double mValue;
63
64
65
};

#endif /* XDMFTIME_HPP_ */