XdmfAttributeType.hpp 2.47 KB
Newer Older
1 2 3
#ifndef XDMFATTRIBUTETYPE_HPP_
#define XDMFATTRIBUTETYPE_HPP_

4
// Includes
5
#include "XdmfItemProperty.hpp"
6

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/**
 * @brief Property describing what types of values an XdmfAttribute contains.
 *
 * XdmfAttributeType is a property used by XdmfAttribute to specify what types of values the XdmfAttribute
 * contains.  A specific XdmfAttributeType can be created by calling one of the static methods
 * in the class, i.e. XdmfAttributeType::Scalar().
 *
 * Xdmf supports the following attribute types:
 * 	NoAttributeType
 * 	Scalar
 * 	Vector
 * 	Tensor
 * 	Matrix
 * 	Tensor6
 * 	GlobalId
 */
23
class XdmfAttributeType : public XdmfItemProperty {
24 25 26

public:

27 28
	virtual ~XdmfAttributeType();

29 30
	friend class XdmfAttribute;

31
	// Supported Xdmf Attribute Types
32 33 34 35 36 37 38
	static boost::shared_ptr<const XdmfAttributeType> NoAttributeType();
	static boost::shared_ptr<const XdmfAttributeType> Scalar();
	static boost::shared_ptr<const XdmfAttributeType> Vector();
	static boost::shared_ptr<const XdmfAttributeType> Tensor();
	static boost::shared_ptr<const XdmfAttributeType> Matrix();
	static boost::shared_ptr<const XdmfAttributeType> Tensor6();
	static boost::shared_ptr<const XdmfAttributeType> GlobalId();
39

40 41
	void getProperties(std::map<std::string, std::string> & collectedProperties) const;

42 43 44
	/*
	 * Compare two XdmfAttributeTypes for equality.
	 *
45 46
	 * @param attributeType an XdmfAttributeType to compare equality to.
	 * @return true if the XdmfAttributeTypes are equal.
47
	 */
48
	bool operator==(const XdmfAttributeType & attributeType) const;
49 50 51 52

	/**
	 * Compare two XdmfAttributeTypes for inequality.
	 *
53 54
	 * @param attributeType an XdmfAttributeType to compare inequality to.
	 * @return true if the XdmfAttributeTypes are not equal.
55
	 */
56
	bool operator!=(const XdmfAttributeType & attributeType) const;
57 58 59 60 61

protected:

	/**
	 * Protected constructor for XdmfAttributeType.  The constructor is protected because all attribute types supported
62 63 64 65
	 * by Xdmf should be accessed through more specific static methods that construct XdmfAttributeTypes - i.e.
	 * XdmfAttributeType::Scalar().
	 *
	 * @param name the name of the XdmfAttributeType to construct.
66
	 */
67
	XdmfAttributeType(const std::string & name);
68 69 70

private:

71 72 73 74
	XdmfAttributeType(const XdmfAttributeType & attributeType); // Not implemented.
	void operator=(const XdmfAttributeType & attributeType); // Not implemented.

	static boost::shared_ptr<const XdmfAttributeType> New(const std::map<std::string, std::string> & itemProperties);
75

76 77 78 79
	std::string mName;
};

#endif /* XDMFATTRIBUTETYPE_HPP_ */