XdmfDomain.hpp 2.88 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4
#ifndef XDMFDOMAIN_HPP_
#define XDMFDOMAIN_HPP_

// Forward Declarations
5
class XdmfCurvilinearGrid;
6
class XdmfGridCollection;
7 8 9
class XdmfRectilinearGrid;
class XdmfRegularGrid;
class XdmfUnstructuredGrid;
Kenneth Leiter's avatar
Kenneth Leiter committed
10 11

// Includes
12
#include "Xdmf.hpp"
13
#include "XdmfItem.hpp"
Kenneth Leiter's avatar
Kenneth Leiter committed
14

15 16 17 18 19 20
/**
 * @brief The root XdmfItem that contains XdmfGrids.
 *
 * XdmfDomain is the top XdmfItem in an Xdmf structure.  It can store a number of grids and
 * provides methods to insert, retrieve, and remove these grids.
 */
21
class XDMF_EXPORT XdmfDomain : public virtual XdmfItem {
Kenneth Leiter's avatar
Kenneth Leiter committed
22 23 24

public:

25 26 27 28 29
	/**
	 * Create a new XdmfDomain.
	 *
	 * @return constructed XdmfDomain.
	 */
30
	static boost::shared_ptr<XdmfDomain> New();
31 32
	virtual ~XdmfDomain();

33
	LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem)
34
	XDMF_CHILDREN(XdmfGridCollection, GridCollection, Name)
35 36 37 38
	XDMF_CHILDREN(XdmfCurvilinearGrid, CurvilinearGrid, Name)
	XDMF_CHILDREN(XdmfRectilinearGrid, RectilinearGrid, Name)
	XDMF_CHILDREN(XdmfRegularGrid, RegularGrid, Name)
	XDMF_CHILDREN(XdmfUnstructuredGrid, UnstructuredGrid, Name)
39
	static const std::string ItemTag;
40

41
	std::map<std::string, std::string> getItemProperties() const;
Kenneth Leiter's avatar
Kenneth Leiter committed
42

43
	virtual std::string getItemTag() const;
44

45 46
	using XdmfItem::insert;

47
	virtual void traverse(const boost::shared_ptr<XdmfBaseVisitor> visitor);
Kenneth Leiter's avatar
Kenneth Leiter committed
48 49 50 51

protected:

	XdmfDomain();
52
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
Kenneth Leiter's avatar
Kenneth Leiter committed
53 54 55

private:

56 57
	XdmfDomain(const XdmfDomain & domain);  // Not implemented.
	void operator=(const XdmfDomain & domain);  // Not implemented.
Kenneth Leiter's avatar
Kenneth Leiter committed
58 59 60

};

61 62 63 64 65 66 67 68 69 70 71 72 73
#ifdef _WIN32
    XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfGridCollection> >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfGridCollection>, std::allocator<boost::shared_ptr<XdmfGridCollection> > >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfCurvilinearGrid> >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfCurvilinearGrid>, std::allocator<boost::shared_ptr<XdmfCurvilinearGrid> > >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfRectilinearGrid> >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfRectilinearGrid>, std::allocator<boost::shared_ptr<XdmfRectilinearGrid> > >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfRegularGrid> >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfRegularGrid>, std::allocator<boost::shared_ptr<XdmfRegularGrid> > >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::allocator<boost::shared_ptr<XdmfUnstructuredGrid> >;
    XDMF_TEMPLATE template class XDMF_EXPORT std::vector<boost::shared_ptr<XdmfUnstructuredGrid>, std::allocator<boost::shared_ptr<XdmfUnstructuredGrid> > >;
#endif

Kenneth Leiter's avatar
Kenneth Leiter committed
74
#endif /* XDMFDOMAIN_HPP_ */