Commit 42286d09 authored by Kenneth Leiter's avatar Kenneth Leiter

ENH: Get equality functions working again, but keep it in the SWIG file rather...

ENH: Get equality functions working again, but keep it in the SWIG file rather the polluting the C++.
parent be7a6349
......@@ -29,6 +29,8 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
#include <XdmfGrid.hpp>
#include <XdmfGridCollection.hpp>
#include <XdmfGridCollectionType.hpp>
#include <XdmfGridRectilinear.hpp>
#include <XdmfGridRegular.hpp>
#include <XdmfItemFactory.hpp>
#include <XdmfMap.hpp>
#include <XdmfReader.hpp>
......@@ -42,194 +44,59 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%import XdmfCore.i
#ifdef SWIGJAVA
%extend XdmfAttributeCenter {
bool equals(boost::shared_ptr<XdmfAttributeCenter> attributeCenter) {
return(self->IsEqual(attributeCenter));
}
};
%extend XdmfAttributeType {
bool equals(boost::shared_ptr<XdmfAttributeType> attributeType) {
return(self->IsEqual(attributeType));
}
};
%extend XdmfGeometryType {
bool equals(boost::shared_ptr<XdmfGeometryType> geometryType) {
return(self->IsEqual(geometryType));
}
};
%extend XdmfGridCollectionType {
bool equals(boost::shared_ptr<XdmfGridCollectionType> collectionType) {
return(self->IsEqual(collectionType));
}
};
%extend XdmfSetType {
bool equals(boost::shared_ptr<XdmfSetType> setType) {
return(self->IsEqual(setType));
}
};
%extend XdmfTopologyType {
bool equals(boost::shared_ptr<XdmfTopologyType> topologyType) {
return(self->IsEqual(topologyType));
}
};
%ignore XdmfTopologyType::operator==(const XdmfTopologyType & topologyType) const;
%ignore XdmfTopologyType::operator!=(const XdmfTopologyType & topologyType) const;
%ignore XdmfSetType::operator==(const XdmfSetType & setType) const;
%ignore XdmfSetType::operator!=(const XdmfSetType & setType) const;
%ignore XdmfGridCollectionType::operator==(const XdmfGridCollectionType & collectionType) const;
%ignore XdmfGridCollectionType::operator!=(const XdmfGridCollectionType & collectionType) const;
%ignore XdmfAttributeCenter::operator==(const XdmfAttributeCenter & attributeCenter) const;
%ignore XdmfAttributeCenter::operator!=(const XdmfAttributeCenter & attributeCenter) const;
%ignore XdmfGeometryType::operator==(const XdmfGeometryType & geometryType) const;
%ignore XdmfGeometryType::operator!=(const XdmfGeometryType & geometryType) const;
%ignore XdmfAttributeType::operator==(const XdmfAttributeType & attributeType) const;
%ignore XdmfAttributeType::operator!=(const XdmfAttributeType & attributeType) const;
%rename(getAttributeUIntConst) XdmfSet::getAttribute(unsigned int const) const;
%rename(getAttributeStrConst) XdmfSet::getAttribute(std::string const &) const;
#endif
#ifdef SWIGPYTHON
%extend XdmfAttributeCenter {
bool __eq__(boost::shared_ptr<XdmfAttributeCenter> attributeCenter) {
return(self->IsEqual(attributeCenter));
}
};
%extend XdmfAttributeType {
bool __eq__(boost::shared_ptr<XdmfAttributeType> attributeType) {
return(self->IsEqual(attributeType));
}
};
%extend XdmfGeometryType {
bool __eq__(boost::shared_ptr<XdmfGeometryType> geometryType) {
return(self->IsEqual(geometryType));
}
};
%extend XdmfGridCollectionType {
bool __eq__(boost::shared_ptr<XdmfGridCollectionType> collectionType) {
return(self->IsEqual(collectionType));
}
};
%extend XdmfSetType {
bool __eq__(boost::shared_ptr<XdmfSetType> setType) {
return(self->IsEqual(setType));
}
};
%extend XdmfTopologyType {
bool __eq__(boost::shared_ptr<XdmfTopologyType> topologyType) {
return(self->IsEqual(topologyType));
}
};
#endif
// Typemaps that work for Java
#ifdef SWIGPYTHON
%pythoncode {
from XdmfCore import *
}
%typemap(out) boost::shared_ptr<XdmfItem> {
if(boost::shared_ptr<XdmfAttribute> attribute = boost::shared_dynamic_cast<XdmfAttribute>($1))
%typemap(out) boost::shared_ptr<XdmfItem> {
if(boost::shared_ptr<XdmfAttribute> value = boost::shared_dynamic_cast<XdmfAttribute>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfAttribute>(attribute)), SWIGTYPE_p_boost__shared_ptrT_XdmfAttribute_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfAttribute > **)&($result) = value ? new boost::shared_ptr< XdmfAttribute >(value) : 0;
}
else if(boost::shared_ptr<XdmfDomain> domain = boost::shared_dynamic_cast<XdmfDomain>($1))
else if(boost::shared_ptr<XdmfDomain> value = boost::shared_dynamic_cast<XdmfDomain>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfDomain>(domain)), SWIGTYPE_p_boost__shared_ptrT_XdmfDomain_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfDomain > **)&($result) = value ? new boost::shared_ptr< XdmfDomain >(value) : 0;
}
else if(boost::shared_ptr<XdmfGeometry> geometry = boost::shared_dynamic_cast<XdmfGeometry>($1))
else if(boost::shared_ptr<XdmfGeometry> value = boost::shared_dynamic_cast<XdmfGeometry>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGeometry>(geometry)), SWIGTYPE_p_boost__shared_ptrT_XdmfGeometry_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfGeometry > **)&($result) = value ? new boost::shared_ptr< XdmfGeometry >(value) : 0;
}
else if(boost::shared_ptr<XdmfGrid> grid = boost::shared_dynamic_cast<XdmfGrid>($1))
else if(boost::shared_ptr<XdmfGrid> value = boost::shared_dynamic_cast<XdmfGrid>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGrid>(grid)), SWIGTYPE_p_boost__shared_ptrT_XdmfGrid_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfGrid > **)&($result) = value ? new boost::shared_ptr< XdmfGrid >(value) : 0;
}
else if(boost::shared_ptr<XdmfGridCollection> gridCollection = boost::shared_dynamic_cast<XdmfGridCollection>($1))
else if(boost::shared_ptr<XdmfGridCollection> value = boost::shared_dynamic_cast<XdmfGridCollection>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridCollection>(gridCollection)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridCollection_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfGridCollection > **)&($result) = value ? new boost::shared_ptr< XdmfGridCollection >(value) : 0;
}
else if(boost::shared_ptr<XdmfInformation> information = boost::shared_dynamic_cast<XdmfInformation>($1))
else if(boost::shared_ptr<XdmfGridRectilinear> value = boost::shared_dynamic_cast<XdmfGridRectilinear>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfInformation>(information)), SWIGTYPE_p_boost__shared_ptrT_XdmfInformation_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfGridRectilinear > **)&($result) = value ? new boost::shared_ptr< XdmfGridRectilinear >(value) : 0;
}
else if(boost::shared_ptr<XdmfMap> map = boost::shared_dynamic_cast<XdmfMap>($1))
else if(boost::shared_ptr<XdmfGridRegular> value = boost::shared_dynamic_cast<XdmfGridRegular>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfMap>(map)), SWIGTYPE_p_boost__shared_ptrT_XdmfMap_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfGridRegular > **)&($result) = value ? new boost::shared_ptr< XdmfGridRegular >(value) : 0;
}
else if(boost::shared_ptr<XdmfSet> set = boost::shared_dynamic_cast<XdmfSet>($1))
else if(boost::shared_ptr<XdmfInformation> value = boost::shared_dynamic_cast<XdmfInformation>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfSet>(set)), SWIGTYPE_p_boost__shared_ptrT_XdmfSet_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfInformation > **)&($result) = value ? new boost::shared_ptr< XdmfInformation >(value) : 0;
}
else if(boost::shared_ptr<XdmfTime> time = boost::shared_dynamic_cast<XdmfTime>($1))
else if(boost::shared_ptr<XdmfSet> value = boost::shared_dynamic_cast<XdmfSet>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfTime>(time)), SWIGTYPE_p_boost__shared_ptrT_XdmfTime_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfSet > **)&($result) = value ? new boost::shared_ptr< XdmfSet >(value) : 0;
}
else if(boost::shared_ptr<XdmfTopology> topology = boost::shared_dynamic_cast<XdmfTopology>($1))
else if(boost::shared_ptr<XdmfTime> value = boost::shared_dynamic_cast<XdmfTime>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfTopology>(topology)), SWIGTYPE_p_boost__shared_ptrT_XdmfTopology_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfTime > **)&($result) = value ? new boost::shared_ptr< XdmfTime >(value) : 0;
}
else if(boost::shared_ptr<XdmfTopology> value = boost::shared_dynamic_cast<XdmfTopology>($1))
{
*(boost::shared_ptr< XdmfTopology > **)&($result) = value ? new boost::shared_ptr< XdmfTopology >(value) : 0;
}
else
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfItem>($1)), SWIGTYPE_p_boost__shared_ptrT_XdmfItem_t, SWIG_POINTER_OWN);
*(boost::shared_ptr< XdmfItem > **)&($result) = &($1);
}
}
#endif
#if 0
%include std_set.i
%template(std_set_uint) std::set<unsigned int>;
// Abstract Base Classes
%template() Loki::Visitor<XdmfSet>;
#endif
#ifdef SWIGJAVA
// Typemaps that work for Java
%typemap(out) boost::shared_ptr<XdmfItem> {
if(boost::shared_ptr<XdmfAttribute> value = boost::shared_dynamic_cast<XdmfAttribute>($1))
{
*(boost::shared_ptr< XdmfAttribute > **)&($result) = value ? new boost::shared_ptr< XdmfAttribute >(value) : 0;
}
else if(boost::shared_ptr<XdmfDomain> value = boost::shared_dynamic_cast<XdmfDomain>($1))
{
*(boost::shared_ptr< XdmfDomain > **)&($result) = value ? new boost::shared_ptr< XdmfDomain >(value) : 0;
}
else if(boost::shared_ptr<XdmfGeometry> value = boost::shared_dynamic_cast<XdmfGeometry>($1))
{
*(boost::shared_ptr< XdmfGeometry > **)&($result) = value ? new boost::shared_ptr< XdmfGeometry >(value) : 0;
}
else if(boost::shared_ptr<XdmfGrid> value = boost::shared_dynamic_cast<XdmfGrid>($1))
{
*(boost::shared_ptr< XdmfGrid > **)&($result) = value ? new boost::shared_ptr< XdmfGrid >(value) : 0;
}
else if(boost::shared_ptr<XdmfGridCollection> value = boost::shared_dynamic_cast<XdmfGridCollection>($1))
{
*(boost::shared_ptr< XdmfGridCollection > **)&($result) = value ? new boost::shared_ptr< XdmfGridCollection >(value) : 0;
}
else if(boost::shared_ptr<XdmfInformation> value = boost::shared_dynamic_cast<XdmfInformation>($1))
{
*(boost::shared_ptr< XdmfInformation > **)&($result) = value ? new boost::shared_ptr< XdmfInformation >(value) : 0;
}
else if(boost::shared_ptr<XdmfSet> value = boost::shared_dynamic_cast<XdmfSet>($1))
{
*(boost::shared_ptr< XdmfSet > **)&($result) = value ? new boost::shared_ptr< XdmfSet >(value) : 0;
}
else if(boost::shared_ptr<XdmfTime> value = boost::shared_dynamic_cast<XdmfTime>($1))
{
*(boost::shared_ptr< XdmfTime > **)&($result) = value ? new boost::shared_ptr< XdmfTime >(value) : 0;
}
else if(boost::shared_ptr<XdmfTopology> value = boost::shared_dynamic_cast<XdmfTopology>($1))
{
*(boost::shared_ptr< XdmfTopology > **)&($result) = value ? new boost::shared_ptr< XdmfTopology >(value) : 0;
}
else
{
*(boost::shared_ptr< XdmfItem > **)&($result) = &($1);
}
}
// Swig+Java will automatically create 'getter' functions for static
// variables in a class (in this case the ItemTag member variable).
......@@ -243,10 +110,12 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%ignore XdmfGeometry::ItemTag;
%ignore XdmfGrid::ItemTag;
%ignore XdmfGridCollection::ItemTag;
%ignore XdmfGridRegular::ItemTag;
%ignore XdmfGridRectilinear::ItemTag;
%ignore XdmfMap::ItemTag;
%ignore XdmfSet::ItemTag;
%ignore XdmfTime::ItemTag;
%ignore XdmfTopology::ItemTag;
%ignore XdmfMap::ItemTag;
// Swig+Java does not like 2 functions with the same prototype that
// simply return const/non-const versions of the same type. We
......@@ -254,6 +123,9 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
// have to change this to rename the function to a new name such
// that we preserve the ability to get a constant variable
%rename(getAttributeUIntConst) XdmfSet::getAttribute(unsigned int const) const;
%rename(getAttributeStrConst) XdmfSet::getAttribute(std::string const &) const;
%ignore XdmfDomain::getGrid(const unsigned int index) const;
%ignore XdmfDomain::getGridCollection(unsigned int const) const;
%ignore XdmfGrid::getAttribute(const unsigned int index) const;
......@@ -269,24 +141,94 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%ignore XdmfSet::getHDF5Controller() const;
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("XdmfCoreJava");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load for XdmfCoreJava\n" + e);
System.exit(1);
}
try {
System.loadLibrary("XdmfJava");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load for XdmfJava\n" + e);
System.exit(1);
}
}
static
{
try
{
System.loadLibrary("XdmfCoreJava");
}
catch (UnsatisfiedLinkError e)
{
System.err.println("Native code library failed to load for XdmfCoreJava\n" + e);
System.exit(1);
}
try
{
System.loadLibrary("XdmfJava");
}
catch (UnsatisfiedLinkError e)
{
System.err.println("Native code library failed to load for XdmfJava\n" + e);
System.exit(1);
}
}
%}
#endif */ SWIGJAVA */
#ifdef SWIGPYTHON
%pythoncode {
from XdmfCore import *
}
%typemap(out) boost::shared_ptr<XdmfItem> {
if(boost::shared_ptr<XdmfAttribute> attribute = boost::shared_dynamic_cast<XdmfAttribute>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfAttribute>(attribute)), SWIGTYPE_p_boost__shared_ptrT_XdmfAttribute_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfDomain> domain = boost::shared_dynamic_cast<XdmfDomain>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfDomain>(domain)), SWIGTYPE_p_boost__shared_ptrT_XdmfDomain_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGeometry> geometry = boost::shared_dynamic_cast<XdmfGeometry>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGeometry>(geometry)), SWIGTYPE_p_boost__shared_ptrT_XdmfGeometry_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGrid> grid = boost::shared_dynamic_cast<XdmfGrid>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGrid>(grid)), SWIGTYPE_p_boost__shared_ptrT_XdmfGrid_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridCollection> gridCollection = boost::shared_dynamic_cast<XdmfGridCollection>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridCollection>(gridCollection)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridCollection_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridRectilinear> gridRectilinear = boost::shared_dynamic_cast<XdmfGridRectilinear>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridRectilinear>(gridRectilinear)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridRectilinear_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfGridRegular> gridRegular = boost::shared_dynamic_cast<XdmfGridRegular>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfGridRegular>(gridRegular)), SWIGTYPE_p_boost__shared_ptrT_XdmfGridRegular_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfInformation> information = boost::shared_dynamic_cast<XdmfInformation>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfInformation>(information)), SWIGTYPE_p_boost__shared_ptrT_XdmfInformation_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfMap> map = boost::shared_dynamic_cast<XdmfMap>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfMap>(map)), SWIGTYPE_p_boost__shared_ptrT_XdmfMap_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfSet> set = boost::shared_dynamic_cast<XdmfSet>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfSet>(set)), SWIGTYPE_p_boost__shared_ptrT_XdmfSet_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfTime> time = boost::shared_dynamic_cast<XdmfTime>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfTime>(time)), SWIGTYPE_p_boost__shared_ptrT_XdmfTime_t, SWIG_POINTER_OWN);
}
else if(boost::shared_ptr<XdmfTopology> topology = boost::shared_dynamic_cast<XdmfTopology>($1))
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfTopology>(topology)), SWIGTYPE_p_boost__shared_ptrT_XdmfTopology_t, SWIG_POINTER_OWN);
}
else
{
$result = SWIG_NewPointerObj(SWIG_as_voidptr(new boost::shared_ptr<XdmfItem>($1)), SWIGTYPE_p_boost__shared_ptrT_XdmfItem_t, SWIG_POINTER_OWN);
}
}
#endif /* SWIGPYTHON */
// Shared Pointer Templates
%shared_ptr(XdmfAttribute)
%shared_ptr(XdmfAttributeCenter)
......@@ -297,6 +239,8 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%shared_ptr(XdmfGrid)
%shared_ptr(XdmfGridCollection)
%shared_ptr(XdmfGridCollectionType)
%shared_ptr(XdmfGridRectilinear)
%shared_ptr(XdmfGridRegular)
%shared_ptr(XdmfItemFactory)
%shared_ptr(XdmfMap)
%shared_ptr(XdmfReader)
......@@ -315,6 +259,8 @@ swig -v -c++ -python -o XdmfPython.cpp Xdmf.i
%include XdmfGrid.hpp
%include XdmfGridCollection.hpp
%include XdmfGridCollectionType.hpp
%include XdmfGridRectilinear.hpp
%include XdmfGridRegular.hpp
%include XdmfItemFactory.hpp
%include XdmfMap.hpp
%include XdmfReader.hpp
......
......@@ -84,8 +84,8 @@ protected:
private:
XdmfAttribute(const XdmfAttribute & attribute); // Not implemented.
void operator=(const XdmfAttribute & attribute); // Not implemented.
XdmfAttribute(const XdmfAttribute &); // Not implemented.
void operator=(const XdmfAttribute &); // Not implemented.
boost::shared_ptr<const XdmfAttributeCenter> mCenter;
std::string mName;
......
......@@ -81,26 +81,6 @@ boost::shared_ptr<const XdmfAttributeCenter> XdmfAttributeCenter::New(const std:
assert(false);
}
bool XdmfAttributeCenter::operator==(const XdmfAttributeCenter & attributeCenter) const
{
return mName.compare(attributeCenter.mName) == 0;
}
bool XdmfAttributeCenter::operator!=(const XdmfAttributeCenter & attributeCenter) const
{
return !this->operator==(attributeCenter);
}
bool XdmfAttributeCenter::IsEqual(boost::shared_ptr<XdmfAttributeCenter> attributeCenter)
{
if(attributeCenter == NULL) return false;
if(this == attributeCenter.get()
&& mName == attributeCenter->mName
) return true;
return false;
}
void XdmfAttributeCenter::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["Center"] = mName;
......
......@@ -35,29 +35,6 @@ public:
void getProperties(std::map<std::string, std::string> & collectedProperties) const;
/**
* Compare two XdmfAttributeCenters for equality.
*
* @param attributeCenter an XdmfAttributeCenter to compare equality to.
* @return true if the XdmfAttributeCenters are equal.
*/
bool operator==(const XdmfAttributeCenter & attributeCenter) const;
/**
* Compare two XdmfAttributeCenters for inequality.
*
* @param attributeCenter an XdmfAttributeCenter to compare inequality to.
* @return true if the XdmfAttributeCenters are not equal.
*/
bool operator!=(const XdmfAttributeCenter & attributeCenter) const;
/**
* Compare two XdmfAttributeCenter for equality (for wrapping)
*
* @param attributeCenter a boost shared pointer to an XdmfAttributeCenter to compare equality to.
* @return true if the XdmfAttributeCenter are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfAttributeCenter> attributeCenter);
protected:
......
......@@ -105,26 +105,6 @@ boost::shared_ptr<const XdmfAttributeType> XdmfAttributeType::New(const std::map
assert(false);
}
bool XdmfAttributeType::operator==(const XdmfAttributeType & attributeType) const
{
return mName.compare(attributeType.mName) == 0;
}
bool XdmfAttributeType::operator!=(const XdmfAttributeType & attributeType) const
{
return !this->operator==(attributeType);
}
bool XdmfAttributeType::IsEqual(boost::shared_ptr<XdmfAttributeType> attributeType)
{
if(attributeType == NULL) return false;
if(this == attributeType.get()
&& mName == attributeType->mName
) return true;
return false;
}
void XdmfAttributeType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
collectedProperties["Type"] = mName;
......
......@@ -39,31 +39,6 @@ public:
void getProperties(std::map<std::string, std::string> & collectedProperties) const;
/*
* Compare two XdmfAttributeTypes for equality.
*
* @param attributeType an XdmfAttributeType to compare equality to.
* @return true if the XdmfAttributeTypes are equal.
*/
bool operator==(const XdmfAttributeType & attributeType) const;
/**
* Compare two XdmfAttributeTypes for inequality.
*
* @param attributeType an XdmfAttributeType to compare inequality to.
* @return true if the XdmfAttributeTypes are not equal.
*/
bool operator!=(const XdmfAttributeType & attributeType) const;
/**
* Compare two XdmfAttributeType for equality (for wrapping)
*
* @param attributeType a boost shared pointer to an XdmfAttributeType to compare equality to.
* @return true if the XdmfAttributeType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfAttributeType> attributeType);
protected:
/**
......
......@@ -107,27 +107,6 @@ boost::shared_ptr<const XdmfGeometryType> XdmfGeometryType::New(const std::map<s
assert(false);
}
bool XdmfGeometryType::operator==(const XdmfGeometryType& geometryType) const
{
return mDimensions == geometryType.mDimensions && mName.compare(geometryType.mName) == 0;
}
bool XdmfGeometryType::operator!=(const XdmfGeometryType& geometryType) const
{
return !this->operator==(geometryType);
}
bool XdmfGeometryType::IsEqual(boost::shared_ptr<XdmfGeometryType> geometryType)
{
if(geometryType == NULL) return false;
if(this == geometryType.get()
&& mDimensions == geometryType->mDimensions
&& mName == geometryType->mName
) return true;
return false;
}
unsigned int XdmfGeometryType::getDimensions() const
{
return mDimensions;
......
......@@ -55,30 +55,6 @@ public:
virtual void getProperties(std::map<std::string, std::string> & collectedProperties) const;
/*
* Compare two XdmfGeometryTypes for equality.
*
* @param geometryType a XdmfGeometryType to compare equality to.
* @return true if the XdmfGeometryTypes are equal.
*/
bool operator==(const XdmfGeometryType & geometryType) const;
/**
* Compare two XdmfGeometryTypes for inequality.
*
* @param geometryType a XdmfGeometryType to compare inequality to.
* @return true if the XdmfGeometryTypes are not equal.
*/
bool operator!=(const XdmfGeometryType & geometryType) const;
/**
* Compare two XdmfGeometryType for equality (for wrapping)
*
* @param geometryType a boost shared pointer to an XdmfGeometryType to compare equality to.
* @return true if the XdmfGeometryType are equal.
*/
bool IsEqual(boost::shared_ptr<XdmfGeometryType> geometryType);
protected:
/**
......
......@@ -61,25 +61,6 @@ boost::shared_ptr<const XdmfGridCollectionType> XdmfGridCollectionType::New(cons
assert(false);
}
bool XdmfGridCollectionType::operator==(const XdmfGridCollectionType & collectionType) const
{
return mName.compare(collectionType.mName) == 0;
}
bool XdmfGridCollectionType::operator!=(const XdmfGridCollectionType & collectionType) const
{
return !this->operator==(collectionType);
}
bool XdmfGridCollectionType::IsEqual(boost::shared_ptr<XdmfGridCollectionType> collectionType)
{
if(collectionType == NULL) return false;