XdmfReader.hpp 3.76 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 : XdmfReader.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
#ifndef XDMFREADER_HPP_
#define XDMFREADER_HPP_

27
// C Compatible Includes
28
#include "Xdmf.hpp"
29
#include "XdmfCoreReader.hpp"
30

31 32
#ifdef __cplusplus

33 34 35
/**
 * @brief Reads an Xdmf file stored on disk into memory.
 *
36 37 38 39
 * Reads an Xdmf file stored on disk into an Xdmf structure in
 * memory. All light data is parsed in order to create appropriate
 * Xdmf objects. Heavy data controllers are created and attached to
 * XdmfArrays but no heavy data is read into memory.
40
 */
41
class XDMF_EXPORT XdmfReader : public XdmfCoreReader {
42

43
public:
44

45 46 47
  /**
   * Create a new XdmfReader.
   *
48 49 50 51
   * Example of use:
   *
   * C++
   *
52
   * @dontinclude ExampleXdmfReader.cpp
53 54
   * @skipline //#initialization
   * @until //#initialization
55 56 57
   *
   * Python
   *
58
   * @dontinclude XdmfExampleReader.py
59 60
   * @skipline #//initialization
   * @until #//initialization
61
   *
62
   * @return    Constructed XdmfReader.
63
   */
64
  static shared_ptr<XdmfReader> New();
65

66
  virtual ~XdmfReader();
67

68 69 70 71 72 73 74 75 76
  /**
   * Uses the internal item factory to create a copy of the internal pointer
   * of the provided shared pointer. Primarily used for C wrapping.
   *
   * @param     original        The source shared pointer that the pointer will be pulled from.
   * @return                    A duplicate of the object contained in the pointer.
   */
  virtual XdmfItem * DuplicatePointer(shared_ptr<XdmfItem> original) const;

77
  shared_ptr<XdmfItem> read(const std::string & filePath) const;
78

79
  std::vector<shared_ptr<XdmfItem> >
80 81
  read(const std::string & filePath,
       const std::string & xPath) const;
82

83 84
  XdmfReader(const XdmfReader &);

85
protected:
86

87
  XdmfReader();
88

89
private:
90

91
  void operator=(const XdmfReader &);  // Not implemented.
92 93
};

94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
#endif

#ifdef __cplusplus
extern "C" {
#endif

// C wrappers go here

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

XDMF_EXPORT XDMFREADER * XdmfReaderNew();

XDMF_EXPORT void XdmfReaderFree(XDMFREADER * item);

XDMF_CORE_READER_C_CHILD_DECLARE(XdmfReader, XDMFREADER, XDMF)

#ifdef __cplusplus
}
#endif

115
#endif /* XDMFREADER_HPP_ */