Commit 305ffbca authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Make ItemTag const so it is cannot be modified.

parent cb10378a
...@@ -22,7 +22,7 @@ XdmfAttribute::~XdmfAttribute() ...@@ -22,7 +22,7 @@ XdmfAttribute::~XdmfAttribute()
std::cout << "Deleted Attribute " << this << std::endl; std::cout << "Deleted Attribute " << this << std::endl;
} }
std::string XdmfAttribute::ItemTag = "Attribute"; const std::string XdmfAttribute::ItemTag = "Attribute";
boost::shared_ptr<const XdmfAttributeCenter> XdmfAttribute::getAttributeCenter() const boost::shared_ptr<const XdmfAttributeCenter> XdmfAttribute::getAttributeCenter() const
{ {
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
virtual ~XdmfAttribute(); virtual ~XdmfAttribute();
LOKI_DEFINE_VISITABLE(XdmfAttribute, XdmfDataItem) LOKI_DEFINE_VISITABLE(XdmfAttribute, XdmfDataItem)
static std::string ItemTag; static const std::string ItemTag;
/** /**
* Get the XdmfAttributeCenter associated with this attribute. * Get the XdmfAttributeCenter associated with this attribute.
......
...@@ -18,7 +18,7 @@ XdmfDomain::~XdmfDomain() ...@@ -18,7 +18,7 @@ XdmfDomain::~XdmfDomain()
std::cout << "Deleted Domain " << this << std::endl; std::cout << "Deleted Domain " << this << std::endl;
} }
std::string XdmfDomain::ItemTag = "Domain"; const std::string XdmfDomain::ItemTag = "Domain";
void XdmfDomain::insert(const boost::shared_ptr<XdmfGrid> grid) void XdmfDomain::insert(const boost::shared_ptr<XdmfGrid> grid)
{ {
......
...@@ -21,7 +21,7 @@ public: ...@@ -21,7 +21,7 @@ public:
virtual ~XdmfDomain(); virtual ~XdmfDomain();
LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem) LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem)
static std::string ItemTag; static const std::string ItemTag;
/** /**
* Get a XdmfGrid attached to the domain. * Get a XdmfGrid attached to the domain.
......
...@@ -21,7 +21,7 @@ XdmfGeometry::~XdmfGeometry() ...@@ -21,7 +21,7 @@ XdmfGeometry::~XdmfGeometry()
std::cout << "Deleted Geometry " << this << std::endl; std::cout << "Deleted Geometry " << this << std::endl;
} }
std::string XdmfGeometry::ItemTag = "Geometry"; const std::string XdmfGeometry::ItemTag = "Geometry";
boost::shared_ptr<const XdmfGeometryType> XdmfGeometry::getGeometryType() const boost::shared_ptr<const XdmfGeometryType> XdmfGeometry::getGeometryType() const
{ {
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
virtual ~XdmfGeometry(); virtual ~XdmfGeometry();
LOKI_DEFINE_VISITABLE(XdmfGeometry, XdmfDataItem) LOKI_DEFINE_VISITABLE(XdmfGeometry, XdmfDataItem)
static std::string ItemTag; static const std::string ItemTag;
/** /**
* Get the XdmfGeometryType associated with this geometry. * Get the XdmfGeometryType associated with this geometry.
......
...@@ -24,7 +24,7 @@ XdmfGrid::~XdmfGrid() ...@@ -24,7 +24,7 @@ XdmfGrid::~XdmfGrid()
std::cout << "Deleted Grid " << this << std::endl; std::cout << "Deleted Grid " << this << std::endl;
} }
std::string XdmfGrid::ItemTag = "Grid"; const std::string XdmfGrid::ItemTag = "Grid";
boost::shared_ptr<XdmfAttribute> XdmfGrid::getAttribute(const unsigned int index) boost::shared_ptr<XdmfAttribute> XdmfGrid::getAttribute(const unsigned int index)
{ {
......
...@@ -26,7 +26,7 @@ public: ...@@ -26,7 +26,7 @@ public:
virtual ~XdmfGrid(); virtual ~XdmfGrid();
LOKI_DEFINE_VISITABLE(XdmfGrid, XdmfItem) LOKI_DEFINE_VISITABLE(XdmfGrid, XdmfItem)
static std::string ItemTag; static const std::string ItemTag;
/** /**
* Get an XdmfAttribute attached to this grid. * Get an XdmfAttribute attached to this grid.
......
...@@ -20,7 +20,7 @@ XdmfGridCollection::~XdmfGridCollection() ...@@ -20,7 +20,7 @@ XdmfGridCollection::~XdmfGridCollection()
std::cout << "Deleted Collection " << this << std::endl; std::cout << "Deleted Collection " << this << std::endl;
} }
std::string XdmfGridCollection::ItemTag = "Grid"; const std::string XdmfGridCollection::ItemTag = "Grid";
boost::shared_ptr<XdmfGrid> XdmfGridCollection::getGrid(const unsigned int index) boost::shared_ptr<XdmfGrid> XdmfGridCollection::getGrid(const unsigned int index)
{ {
......
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
virtual ~XdmfGridCollection(); virtual ~XdmfGridCollection();
LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid) LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid)
static std::string ItemTag; static const std::string ItemTag;
/** /**
* Get a grid from this collection. * Get a grid from this collection.
......
...@@ -20,7 +20,7 @@ XdmfSet::~XdmfSet() ...@@ -20,7 +20,7 @@ XdmfSet::~XdmfSet()
std::cout << "Deleted Set " << this << std::endl; std::cout << "Deleted Set " << this << std::endl;
} }
std::string XdmfSet::ItemTag = "Set"; const std::string XdmfSet::ItemTag = "Set";
std::string XdmfSet::getName() const std::string XdmfSet::getName() const
{ {
......
...@@ -23,7 +23,7 @@ public: ...@@ -23,7 +23,7 @@ public:
virtual ~XdmfSet(); virtual ~XdmfSet();
LOKI_DEFINE_VISITABLE(XdmfSet, XdmfDataItem) LOKI_DEFINE_VISITABLE(XdmfSet, XdmfDataItem)
static std::string ItemTag; const static std::string ItemTag;
/** /**
* Get the XdmfSetType associated with this set. * Get the XdmfSetType associated with this set.
......
...@@ -22,7 +22,7 @@ XdmfTopology::~XdmfTopology() ...@@ -22,7 +22,7 @@ XdmfTopology::~XdmfTopology()
std::cout << "Deleted Topology " << this << std::endl; std::cout << "Deleted Topology " << this << std::endl;
} }
std::string XdmfTopology::ItemTag = "Topology"; const std::string XdmfTopology::ItemTag = "Topology";
std::string XdmfTopology::getItemTag() const std::string XdmfTopology::getItemTag() const
{ {
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
virtual ~XdmfTopology(); virtual ~XdmfTopology();
LOKI_DEFINE_VISITABLE(XdmfTopology, XdmfDataItem) LOKI_DEFINE_VISITABLE(XdmfTopology, XdmfDataItem)
static std::string ItemTag; static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const; std::map<std::string, std::string> getItemProperties() const;
......
...@@ -319,7 +319,7 @@ XdmfArray::~XdmfArray() ...@@ -319,7 +319,7 @@ XdmfArray::~XdmfArray()
std::cout << "Deleted Array " << this << std::endl; std::cout << "Deleted Array " << this << std::endl;
} }
std::string XdmfArray::ItemTag = "DataItem"; const std::string XdmfArray::ItemTag = "DataItem";
void XdmfArray::clear() void XdmfArray::clear()
{ {
......
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
LOKI_DEFINE_VISITABLE(XdmfArray, XdmfItem) LOKI_DEFINE_VISITABLE(XdmfArray, XdmfItem)
friend class XdmfHDF5Writer; friend class XdmfHDF5Writer;
static std::string ItemTag; static const std::string ItemTag;
/** /**
* Copy values from an XdmfArray into this array. * Copy values from an XdmfArray into this array.
......
set(XdmfCoreCxxTests set(XdmfCoreCxxTests
TestXdmfArray TestXdmfArray
TestXdmfArrayWriteRead TestXdmfArrayWriteRead
TestXdmfDataItem
TestXdmfHDF5Writer TestXdmfHDF5Writer
) )
......
#include "XdmfDataItem.hpp"
int main(int argc, char* argv[])
{
//boost::shared_ptr<XdmfDataItem> dataItem = XdmfDataItem::New();
//int intArray[10] = {1,2,3,4,5,6,7,8,9,10};
//dataItem->setValues(intArray);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment