File: XdmfDiff.hpp

package info (click to toggle)
xdmf 3.0%2Bgit20160803-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 35,388 kB
  • ctags: 36,627
  • sloc: ansic: 265,382; cpp: 162,889; python: 10,976; f90: 1,378; yacc: 687; fortran: 464; xml: 200; java: 187; lex: 125; makefile: 82; sh: 28
file content (127 lines) | stat: -rw-r--r-- 3,756 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*****************************************************************************/
/*                                    XDMF                                   */
/*                       eXtensible Data Model and Format                    */
/*                                                                           */
/*  Id : XdmfDiff.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.                                                 */
/*                                                                           */
/*****************************************************************************/

#ifndef XDMFDIFF_HPP_
#define XDMFDIFF_HPP_

// C Compatible Includes
#include "XdmfUtils.hpp"

#ifdef __cplusplus

// Forward Declarations
class XdmfItem;

// Includes
#include <string>
#include "XdmfUtils.hpp"
#include "XdmfSharedPtr.hpp"

/**
 * @brief Compare differences between data stored in two Xdmf
 * structures.
 */
class XDMFUTILS_EXPORT XdmfDiff {

public:

  /**
   * Create a new XdmfDiff.
   *
   * @return constructed XdmfDiff.
   */
  static shared_ptr<XdmfDiff> New();

  virtual ~XdmfDiff();

  /**
   * Compare the contents of two Xdmf structures.
   *
   * @param item1 an Xdmf structure to compare.
   * @param item2 an Xdmf structure to compare.
   *
   * @return true if the Xdmf structures are equivalent.
   */
  bool
  compare(const shared_ptr<XdmfItem> item1,
          const shared_ptr<XdmfItem> item2) const;

  /**
   * Get the absolute tolerance used for comparing values between Xdmf
   * structures.
   *
   * @return double the absolute tolerance.
   */
  double
  getAbsoluteTolerance() const;

  /**
   * Set the absolute tolerance for comparing values between Xdmf
   * structures.
   *
   * @param absoluteTolerance the absolute tolerance to set.
   */
  void
  setAbsoluteTolerance(const double absoluteTolerance);

  XdmfDiff(const XdmfDiff &);

protected:

  XdmfDiff();

private:

  void operator=(const XdmfDiff &);  // Not implemented.

  double mAbsoluteTolerance;

};

#endif

#ifdef __cplusplus
extern "C" {
#endif

// C wrappers go here

struct XDMFDIFF; // Simply as a typedef to ensure correct typing
typedef struct XDMFDIFF XDMFDIFF;

XDMFUTILS_EXPORT XDMFDIFF * XdmfDiffNew();

XDMFUTILS_EXPORT int XdmfDiffCompare(XDMFDIFF * diff, XDMFITEM * item1, XDMFITEM * item2);

XDMFUTILS_EXPORT double XdmfDiffGetAbsoluteTolerance(XDMFDIFF * diff);

XDMFUTILS_EXPORT void XdmfDiffSetAbsoluteTolerance(XDMFDIFF * diff, double tolerance);

XDMFUTILS_EXPORT void XdmfDiffFree(XDMFDIFF * diff);

#ifdef __cplusplus
}
#endif

#endif /* XDMFDIFF_HPP_ */