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

4
// Includes
5 6
#include <string>

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 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
class XdmfAttributeType {

public:

	// Supported Xdmf Attribute Types
	static XdmfAttributeType NoAttributeType();
	static XdmfAttributeType Scalar();
	static XdmfAttributeType Vector();
	static XdmfAttributeType Tensor();
	static XdmfAttributeType Matrix();
	static XdmfAttributeType Tensor6();
	static XdmfAttributeType GlobalId();

	/**
	 * Get the name of this attribute type
	 *
	 * @return a string containing the name.
	 */
	std::string getName() const;

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

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

59 60
	XdmfAttributeType(const XdmfAttributeType & attributeType);
	XdmfAttributeType& operator=(const XdmfAttributeType & attributeType);
61 62 63 64 65

protected:

	/**
	 * Protected constructor for XdmfAttributeType.  The constructor is protected because all attribute types supported
66 67 68 69
	 * 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.
70
	 */
71
	XdmfAttributeType(const std::string & name);
72 73 74 75 76 77 78

private:

	std::string mName;
};

#endif /* XDMFATTRIBUTETYPE_HPP_ */