XdmfDataItem.hpp 1.39 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:

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

	/**
28
	 * 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
29
	 *
30
	 * @return a smart pointer to the XdmfArray.
Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
31 32
	 */
	boost::shared_ptr<const XdmfArray> getArray() const;
33

34 35
	std::string printSelf() const;

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<XdmfVisitor> visitor) const;
44
	virtual void write(boost::shared_ptr<XdmfVisitor> visitor) const = 0;
45 46 47 48 49 50 51 52

protected:

	XdmfDataItem();
	virtual ~XdmfDataItem();

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_ */