XdmfTime.hpp 3.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 43 44 45
  /**
   * Create a new XdmfTime.
   *
   * @param value the timeValue of the XdmfTime to create.
   * @return the new XdmfTime.
   */
46
  static shared_ptr<XdmfTime> New(const double & value = 0);
47

48
  virtual ~XdmfTime();
49

50 51
  LOKI_DEFINE_VISITABLE(XdmfTime, XdmfItem);
  static const std::string ItemTag;
52

53
  std::map<std::string, std::string> getItemProperties() const;
54

55
  std::string getItemTag() const;
56

57 58 59 60 61 62
  /**
   * Get the time value associated with this XdmfTime.
   *
   * @return a double containing the time value.
   */
  double getValue() const;
63

64 65 66 67 68 69
  /**
   * Set the time value associated with this XdmfTime.
   *
   * @param time a double containing the time value.
   */
  void setValue(const double & time);
70

71
protected:
72

73
  XdmfTime(const double & value);
74

75 76
  virtual void
  populateItem(const std::map<std::string, std::string> & itemProperties,
77
               std::vector<shared_ptr<XdmfItem> > & childItems,
78
               const XdmfCoreReader * const reader);
79

80
private:
81

82 83 84 85
  XdmfTime(const XdmfTime &);  // Not implemented.
  void operator=(const XdmfTime &);  // Not implemented.

  double mValue;
86 87 88
};

#endif /* XDMFTIME_HPP_ */