XdmfDomain.hpp 1.76 KB
Newer Older
Kenneth Leiter's avatar
Kenneth Leiter committed
1 2 3 4 5 6 7 8 9 10
#ifndef XDMFDOMAIN_HPP_
#define XDMFDOMAIN_HPP_

// Forward Declarations
class XdmfGrid;

// Includes
#include "XdmfItem.hpp"
#include <vector>

11 12 13 14 15 16
/**
 * @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.
 */
Kenneth Leiter's avatar
Kenneth Leiter committed
17 18 19 20 21
class XdmfDomain : public XdmfItem {

public:

	XdmfNewMacro(XdmfDomain);
22
	LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem)
23

Kenneth Leiter's avatar
Kenneth Leiter committed
24
	/**
25 26 27 28
	 * Get a XdmfGrid attached to the domain.
	 *
	 * @param index an unsigned int of the grid to retrieve.
	 * @return smart pointer to the grid at the specified index attached to this domain.
Kenneth Leiter's avatar
Kenneth Leiter committed
29
	 */
30
	boost::shared_ptr<XdmfGrid> getGrid(unsigned int index);
Kenneth Leiter's avatar
Kenneth Leiter committed
31 32

	/**
33
	 * Get a XdmfGrid attached to this domain (const version).
Kenneth Leiter's avatar
Kenneth Leiter committed
34 35 36 37
	 *
	 * @param index of the grid to retrieve.
	 * @return pointer to the grid attached to this domain.
	 */
38
	boost::shared_ptr<const XdmfGrid> getGrid(unsigned int index) const;
Kenneth Leiter's avatar
Kenneth Leiter committed
39

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

42 43
	std::string getItemTag() const;

Kenneth Leiter's avatar
Kenneth Leiter committed
44
	/**
45 46 47
	 * Get the number of XdmfGrids attached to this domain.
	 *
	 * @return unsigned int containing the number of XdmfGrids attached to this domain.
Kenneth Leiter's avatar
Kenneth Leiter committed
48 49 50
	 */
	unsigned int getNumberOfGrids() const;

51 52 53 54 55 56 57
	/**
	 * Insert a XdmfGrid into the domain.
	 *
	 * @param grid a shared pointer to an XdmfGrid to insert into the domain.
	 */
	void insert(boost::shared_ptr<XdmfGrid> grid);

58
	virtual void traverse(boost::shared_ptr<Loki::BaseVisitor> visitor);
Kenneth Leiter's avatar
Kenneth Leiter committed
59 60 61 62 63 64 65 66

protected:

	XdmfDomain();
	virtual ~XdmfDomain();

private:

67 68
	XdmfDomain(const XdmfDomain & domain);  // Not implemented.
	void operator=(const XdmfDomain & domain);  // Not implemented.
Kenneth Leiter's avatar
Kenneth Leiter committed
69 70 71 72 73

	std::vector<boost::shared_ptr<XdmfGrid> > mGrids;
};

#endif /* XDMFDOMAIN_HPP_ */