-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathXdmfReader.cpp
83 lines (71 loc) · 2.94 KB
/
XdmfReader.cpp
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
/*****************************************************************************/
/* XDMF */
/* eXtensible Data Model and Format */
/* */
/* Id : XdmfReader.cpp */
/* */
/* Author: */
/* Kenneth Leiter */
/* [email protected] */
/* 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. */
/* */
/*****************************************************************************/
#include "XdmfItemFactory.hpp"
#include "XdmfReader.hpp"
#include "XdmfError.hpp"
shared_ptr<XdmfReader>
XdmfReader::New()
{
shared_ptr<XdmfReader> p(new XdmfReader());
return p;
}
XdmfReader::XdmfReader() :
XdmfCoreReader(XdmfItemFactory::New())
{
}
XdmfReader::XdmfReader(const XdmfReader &) :
XdmfCoreReader(XdmfItemFactory::New())
{
}
XdmfReader::~XdmfReader()
{
}
XdmfItem *
XdmfReader::DuplicatePointer(shared_ptr<XdmfItem> original) const
{
return XdmfCoreReader::DuplicatePointer(original);
}
// Implemented to make SWIG wrapping work correctly
// (typemaps to return specific subclass instances of XdmfItems)
shared_ptr<XdmfItem>
XdmfReader::read(const std::string & filePath) const
{
return XdmfCoreReader::read(filePath);
}
std::vector<shared_ptr<XdmfItem> >
XdmfReader::read(const std::string & filePath,
const std::string & xPath) const
{
return XdmfCoreReader::read(filePath, xPath);
}
// C Wrappers
XDMFREADER * XdmfReaderNew()
{
shared_ptr<XdmfReader> returnReader = XdmfReader::New();
return (XDMFREADER *)((void *)(new XdmfReader(*returnReader.get())));
}
void XdmfReaderFree(XDMFREADER * item)
{
delete ((XdmfReader *)item);
}
XDMF_CORE_READER_C_CHILD_WRAPPER(XdmfReader, XDMFREADER)