XdmfAttribute.hpp 2.36 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 "XdmfArray.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 XdmfArray {
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
18

19 20
public:

21 22 23 24 25
	/**
	 * Create a new XdmfAttribute.
	 *
	 * @return constructed XdmfAttribute.
	 */
26
	static boost::shared_ptr<XdmfAttribute> New();
27

28 29
	virtual ~XdmfAttribute();

30
	LOKI_DEFINE_VISITABLE(XdmfAttribute, XdmfArray)
31
	static const std::string ItemTag;
32

33
	/**
34
	 * Get the XdmfAttributeCenter associated with this attribute.
35
	 *
36
	 * @return XdmfAttributeCenter of the attribute.
37
	 */
38
	boost::shared_ptr<const XdmfAttributeCenter> getCenter() const;
39 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
	 * Get the XdmfAttributeType associated with this attribute.
54
	 *
55
	 * @return XdmfAttributeType of the attribute.
56
	 */
57
	boost::shared_ptr<const XdmfAttributeType> getType() const;
58 59

	/**
60
	 * Set the XdmfAttributeCenter associated with this attribute.
61
	 *
62
	 * @param center the XdmfAttributeCenter to set.
63
	 */
64
	void setCenter(const boost::shared_ptr<const XdmfAttributeCenter> center);
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
	/**
	 * Set the XdmfAttributeType associated with this attribute.
	 *
76
	 * @param type XdmfAttributeType to set.
77
	 */
78
	void setType(const boost::shared_ptr<const XdmfAttributeType> type);
79

80 81 82
protected:

	XdmfAttribute();
83
	virtual void populateItem(const std::map<std::string, std::string> & itemProperties, std::vector<boost::shared_ptr<XdmfItem> > & childItems, const XdmfCoreReader * const reader);
84 85 86

private:

87 88
	XdmfAttribute(const XdmfAttribute & attribute);  // Not implemented.
	void operator=(const XdmfAttribute & attribute);  // Not implemented.
89

90
	boost::shared_ptr<const XdmfAttributeCenter> mCenter;
91
	std::string mName;
92
	boost::shared_ptr<const XdmfAttributeType> mType;
Ken Leiter (Civ's avatar
Ken Leiter (Civ committed
93 94 95
};

#endif /* XDMFATTRIBUTE_HPP_ */