XdmfGridCollectionType.hpp 2.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#ifndef XDMFGRIDCOLLECTIONTYPE_HPP_
#define XDMFGRIDCOLLECTIONTYPE_HPP_

// Includes
#include "XdmfItemProperty.hpp"

/**
 * @brief Property describing the type of an XdmfGridCollection.
 *
 * XdmfGridCollectionType is a property used by XdmfGridCollection to specify what type of collection the
 * XdmfGridCollection contains.  A specific XdmfGridCollectionType can be created by calling one of the static methods
 * in the class, i.e. XdmfGridCollectionType::Temporal().
 *
 * Xdmf supports the following collection types:
 * 	NoCollectionType
 * 	Spatial
 * 	Temporal
 */
class XdmfGridCollectionType : public XdmfItemProperty {

public:

23 24
	virtual ~XdmfGridCollectionType();

25 26 27
	friend class XdmfGridCollection;

	// Supported XdmfGridCollectionTypes
28 29 30
	static boost::shared_ptr<const XdmfGridCollectionType> NoCollectionType();
	static boost::shared_ptr<const XdmfGridCollectionType> Spatial();
	static boost::shared_ptr<const XdmfGridCollectionType> Temporal();
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

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

	/*
	 * Compare two XdmfGridCollectionTypes for equality.
	 *
	 * @param collectionType an XdmfGridCollectionType to compare equality to.
	 * @return true if the XdmfGridCollectionTypes are equal.
	 */
	bool operator==(const XdmfGridCollectionType & collectionype) const;

	/**
	 * Compare two XdmfGridCollectionTypes for inequality.
	 *
	 * @param collectionType an XdmfGridCollectionType to compare inequality to.
	 * @return true if the XdmfGridCollectionTypes are not equal.
	 */
	bool operator!=(const XdmfGridCollectionType & collectionType) const;

protected:

	/**
	 * Protected constructor for XdmfGridCollectionType.  The constructor is protected because all collection types supported
	 * by Xdmf should be accessed through more specific static methods that construct XdmfGridCollectionType - i.e.
	 * XdmfGridCollectionType::Temporal().
	 *
	 * @param name the name of the XdmfGridCollectionType to construct.
	 */
	XdmfGridCollectionType(const std::string & name);

private:

63 64 65 66
	XdmfGridCollectionType(const XdmfGridCollectionType & collectionType); // Not implemented.
	void operator=(const XdmfGridCollectionType & collectionType); // Not implemented.

	static boost::shared_ptr<const XdmfGridCollectionType> New(const std::map<std::string, std::string> & itemProperties);
67 68 69 70 71

	std::string mName;
};

#endif /* XDMFGRIDCOLLECTIONTYPE_HPP_ */