XdmfDomain.hpp 1.73 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 22 23
class XdmfDomain : public XdmfItem {

public:

	XdmfNewMacro(XdmfDomain);

	/**
24 25 26 27
	 * 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
28
	 */
29
	boost::shared_ptr<XdmfGrid> getGrid(unsigned int index);
Kenneth Leiter's avatar
Kenneth Leiter committed
30 31

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

	/**
40
	 * Insert a XdmfGrid into the domain.
Kenneth Leiter's avatar
Kenneth Leiter committed
41
	 *
42
	 * @param grid a shared pointer to an XdmfGrid to insert into the domain.
Kenneth Leiter's avatar
Kenneth Leiter committed
43
	 */
44
	void insert(boost::shared_ptr<XdmfGrid> grid);
Kenneth Leiter's avatar
Kenneth Leiter committed
45 46

	/**
47 48 49
	 * 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
50 51 52 53 54
	 */
	unsigned int getNumberOfGrids() const;

	virtual std::string printSelf() const;

55
	virtual void traverse(boost::shared_ptr<XdmfVisitor> visitor) const;
Kenneth Leiter's avatar
Kenneth Leiter committed
56 57 58 59 60 61 62 63 64
	virtual void write(boost::shared_ptr<XdmfVisitor> visitor) const;

protected:

	XdmfDomain();
	virtual ~XdmfDomain();

private:

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

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

#endif /* XDMFDOMAIN_HPP_ */