XdmfDataItem.hpp 1.47 KB
Newer Older
1 2 3
#ifndef XDMFDATAITEM_HPP_
#define XDMFDATAITEM_HPP_

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
4 5 6 7
// Forward Declarations
class XdmfArray;

// Includes
8 9
#include "XdmfItem.hpp"

10 11 12 13 14 15
/**
 * @brief A type of XdmfItem that holds data values in an XdmfArray.
 *
 * XdmfDataItem is an abstract base class.  Any part of the Xdmf graph structure that holds values
 * in an XdmfArray inherits from this.  XdmfDataItem imbues the ability to store and retrieve XdmfArrays.
 */
16 17 18 19
class XdmfDataItem : public XdmfItem {

public:

20 21
	LOKI_DEFINE_VISITABLE(XdmfDataItem, XdmfItem)

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
22
	/**
23
	 * Get the XdmfArray attached to this XdmfDataItem.
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
24
	 *
25
	 * @return a smart pointer to the XdmfArray.
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
26 27 28 29
	 */
	boost::shared_ptr<XdmfArray> getArray();

	/**
30
	 * Get the XdmfArray attached to this XdmfDataItem (const version).
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
31
	 *
32
	 * @return a smart pointer to the XdmfArray.
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
33 34
	 */
	boost::shared_ptr<const XdmfArray> getArray() const;
35

36 37 38 39 40 41 42
	/**
	 * Attach an XdmfArray to this XdmfDataItem.
	 *
	 * @param array a smart pointer to the XdmfArray.
	 */
	void setArray(boost::shared_ptr<XdmfArray> array);

43
	virtual void traverse(boost::shared_ptr<Loki::BaseVisitor> visitor);
44 45 46 47 48

protected:

	XdmfDataItem();
	virtual ~XdmfDataItem();
49
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem > > & childItems);
50 51 52

private:

53 54
	XdmfDataItem(const XdmfDataItem & dataItem);  // Not implemented.
	void operator=(const XdmfDataItem & dataItem);  // Not implemented.
55

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
56
	boost::shared_ptr<XdmfArray> mArray;
57 58 59
};

#endif /* XDMFDATAITEM_HPP_ */