XdmfCoreReader.hpp 1.72 KB
Newer Older
1 2 3 4 5 6 7 8
#ifndef XDMFCOREREADER_HPP_
#define XDMFCOREREADER_HPP_

// Forward Declarations
class XdmfCoreItemFactory;
class XdmfItem;

// Includes
9 10
#include <boost/shared_ptr.hpp>
#include <string>
11
#include <vector>
12 13 14 15 16 17 18

/**
 * @brief Reads an Xdmf structured file stored on disk into memory.
 *
 * Reads an Xdmf structured 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.
 */
19
class XdmfCoreReader {
20 21 22 23 24

public:

	virtual ~XdmfCoreReader();

25 26 27
	/**
	 * Read an Xdmf file from disk into memory.
	 *
28
	 * @param filePath the path of the Xdmf file to read in from disk.
29 30
	 * @return an XdmfItem at the root of the Xdmf tree.
	 */
31
	virtual boost::shared_ptr<XdmfItem> read(const std::string & filePath) const;
32

33 34 35 36 37 38 39 40 41
	/**
	 * Read part of an Xdmf file from disk into memory.
	 *
	 * @param filePath the path of the Xdmf file to read in from disk.
	 * @param xPath an XPath corresponding to the portion of the file to read.
	 * @return a vector of XdmfItems that are included in the XPath.
	 */
	virtual std::vector<boost::shared_ptr<XdmfItem> > read(const std::string & filePath, const std::string & xPath) const;

42 43
protected:

44 45 46 47 48
	/**
	 * Constructor
	 *
	 * @param itemFactory an XdmfCoreItemFactory to construct XdmfItems for a specific Xdmf language.
	 */
49
	XdmfCoreReader(const boost::shared_ptr<const XdmfCoreItemFactory> itemFactory);
50 51 52 53 54 55 56 57 58 59 60

private:

	/**
	 * PIMPL
	 */
	class XdmfCoreReaderImpl;

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

61
	const XdmfCoreReaderImpl * const mImpl;
62 63 64
};

#endif /* XDMFCOREREADER_HPP_ */