XdmfReader.hpp 3.31 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
  shared_ptr<XdmfItem> read(const std::string & filePath) const;
69

70
  std::vector<shared_ptr<XdmfItem> >
71 72
  read(const std::string & filePath,
       const std::string & xPath) const;
73

74
protected:
75

76
  XdmfReader();
77

78
private:
79

80
  void operator=(const XdmfReader &);  // Not implemented.
81 82
};

83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
#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

104
#endif /* XDMFREADER_HPP_ */