XdmfAttribute.hpp 2.32 KB
Newer Older
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
1 2 3
#ifndef XDMFATTRIBUTE_HPP_
#define XDMFATTRIBUTE_HPP_

4 5 6 7
// Forward Declarations
class XdmfAttributeCenter;
class XdmfAttributeType;

Ken Leiter (Civ ARL/CISD) kleiter's avatar
ENH:  
Ken Leiter (Civ ARL/CISD) kleiter committed
8
// Includes
9
#include "XdmfDataItem.hpp"
10

11 12 13 14 15 16
/**
 * @brief Handles computed values attached to an XdmfGrid.
 *
 * XdmfAttribute contains two properties that should be set, XdmfAttributeCenter and XdmfAttributeType.
 * XdmfAttribute is a subclass of XdmfDataItem, meaning it contains an XdmfArray to store values.
 */
17
class XdmfAttribute : public XdmfDataItem {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
18

19 20
public:

Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
21
	XdmfNewMacro(XdmfAttribute);
22 23
	virtual ~XdmfAttribute();

24
	LOKI_DEFINE_VISITABLE(XdmfAttribute, XdmfDataItem)
25
	static const std::string ItemTag;
26

27
	/**
28
	 * Get the XdmfAttributeCenter associated with this attribute.
29
	 *
30
	 * @return XdmfAttributeCenter of the attribute.
31
	 */
32
	boost::shared_ptr<const XdmfAttributeCenter> getAttributeCenter() const;
33 34

	/**
35
	 * Get the XdmfAttributeType associated with this attribute.
36
	 *
37
	 * @return XdmfAttributeType of the attribute.
38
	 */
39
	boost::shared_ptr<const XdmfAttributeType> getAttributeType() const;
40

41 42
	std::map<std::string, std::string> getItemProperties() const;

43 44
	std::string getItemTag() const;

45
	/**
46
	 * Get the name of the attribute.
47
	 *
48
	 * @return a string containing the name of the attribute.
49
	 */
50
	std::string getName() const;
51

52
	/**
53
	 * Set the XdmfAttributeCenter associated with this attribute.
54
	 *
55
	 * @param attributeCenter the XdmfAttributeCenter to set.
56
	 */
57
	void setAttributeCenter(const boost::shared_ptr<const XdmfAttributeCenter> attributeCenter);
58 59

	/**
60
	 * Set the XdmfAttributeType associated with this attribute.
61
	 *
62
	 * @param attributeType XdmfAttributeType to set.
63
	 */
64
	void setAttributeType(const boost::shared_ptr<const XdmfAttributeType> attributeType);
65 66

	/**
67
	 * Set the name of the attribute.
68
	 *
69
	 * @param name a string containing the name to set.
70
	 */
71
	void setName(const std::string & name);
72 73 74 75

protected:

	XdmfAttribute();
76
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems);
77 78 79

private:

80 81
	XdmfAttribute(const XdmfAttribute & attribute);  // Not implemented.
	void operator=(const XdmfAttribute & attribute);  // Not implemented.
82 83

	std::string mName;
84 85
	boost::shared_ptr<const XdmfAttributeType> mAttributeType;
	boost::shared_ptr<const XdmfAttributeCenter> mAttributeCenter;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
86 87 88
};

#endif /* XDMFATTRIBUTE_HPP_ */