Commit 7f5d7003 authored by Andrew J. Burns's avatar Andrew J. Burns Committed by Andrew J. Burns (Cont

Rework of HeavyDataController and HDF5Controller to remove extra code and move...

Rework of HeavyDataController and HDF5Controller to remove extra code and move HeavyDataController away from being too dependent on hdf5 style
XdmfFunction now supports negative numbers in addition to the - operator
Reworked the interaction between array references and reading
Cleaned up some warnings that showed up in pedantic
Adjusted mpi tests to test against the MPIEXEC variable as opposed to hard calling mpirun
Still needs to be changed to work better with Cray mpi style execution
Updates to XdmfArrayType to allow for signed and floating point checking
General test and Documentation updates
parent 975536e3
......@@ -92,6 +92,9 @@ if(XDMF_WRAP_PYTHON)
#Enables DSM
if (XDMF_BUILD_DSM)
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -DXDMF_BUILD_DSM)
if (XDMF_BUILD_DSM_THREADS)
set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -DXDMF_BUILD_DSM_THREADS)
endif (XDMF_BUILD_DSM_THREADS)
endif (XDMF_BUILD_DSM)
set_source_files_properties(${python_name}.i PROPERTIES CPLUSPLUS ON)
set(swig_extra_generated_files "")
......
......@@ -68,7 +68,7 @@ public:
virtual ~XdmfAttribute();
LOKI_DEFINE_VISITABLE(XdmfAttribute, XdmfArray);
LOKI_DEFINE_VISITABLE(XdmfAttribute, XdmfArray)
static const std::string ItemTag;
/**
......
......@@ -132,7 +132,7 @@ public:
virtual ~XdmfCurvilinearGrid();
LOKI_DEFINE_VISITABLE(XdmfCurvilinearGrid, XdmfGrid);
LOKI_DEFINE_VISITABLE(XdmfCurvilinearGrid, XdmfGrid)
static const std::string ItemTag;
/**
......
......@@ -70,13 +70,13 @@ public:
virtual ~XdmfDomain();
LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem);
XDMF_CHILDREN(XdmfDomain, XdmfGridCollection, GridCollection, Name);
XDMF_CHILDREN(XdmfDomain, XdmfGraph, Graph, Name);
XDMF_CHILDREN(XdmfDomain, XdmfCurvilinearGrid, CurvilinearGrid, Name);
XDMF_CHILDREN(XdmfDomain, XdmfRectilinearGrid, RectilinearGrid, Name);
XDMF_CHILDREN(XdmfDomain, XdmfRegularGrid, RegularGrid, Name);
XDMF_CHILDREN(XdmfDomain, XdmfUnstructuredGrid, UnstructuredGrid, Name);
LOKI_DEFINE_VISITABLE(XdmfDomain, XdmfItem)
XDMF_CHILDREN(XdmfDomain, XdmfGridCollection, GridCollection, Name)
XDMF_CHILDREN(XdmfDomain, XdmfGraph, Graph, Name)
XDMF_CHILDREN(XdmfDomain, XdmfCurvilinearGrid, CurvilinearGrid, Name)
XDMF_CHILDREN(XdmfDomain, XdmfRectilinearGrid, RectilinearGrid, Name)
XDMF_CHILDREN(XdmfDomain, XdmfRegularGrid, RegularGrid, Name)
XDMF_CHILDREN(XdmfDomain, XdmfUnstructuredGrid, UnstructuredGrid, Name)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -66,7 +66,7 @@ public:
virtual ~XdmfGeometry();
LOKI_DEFINE_VISITABLE(XdmfGeometry, XdmfArray);
LOKI_DEFINE_VISITABLE(XdmfGeometry, XdmfArray)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -66,8 +66,8 @@ public:
virtual ~XdmfGraph();
LOKI_DEFINE_VISITABLE(XdmfGraph, XdmfSparseMatrix);
XDMF_CHILDREN(XdmfGraph, XdmfAttribute, Attribute, Name);
LOKI_DEFINE_VISITABLE(XdmfGraph, XdmfSparseMatrix)
XDMF_CHILDREN(XdmfGraph, XdmfAttribute, Attribute, Name)
static const std::string ItemTag;
std::string getItemTag() const;
......
......@@ -57,10 +57,10 @@ public:
virtual ~XdmfGrid() = 0;
LOKI_DEFINE_VISITABLE(XdmfGrid, XdmfItem);
XDMF_CHILDREN(XdmfGrid, XdmfAttribute, Attribute, Name);
XDMF_CHILDREN(XdmfGrid, XdmfSet, Set, Name);
XDMF_CHILDREN(XdmfGrid, XdmfMap, Map, Name);
LOKI_DEFINE_VISITABLE(XdmfGrid, XdmfItem)
XDMF_CHILDREN(XdmfGrid, XdmfAttribute, Attribute, Name)
XDMF_CHILDREN(XdmfGrid, XdmfSet, Set, Name)
XDMF_CHILDREN(XdmfGrid, XdmfMap, Map, Name)
static const std::string ItemTag;
/**
......
......@@ -71,7 +71,7 @@ public:
virtual ~XdmfGridCollection();
LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid);
LOKI_DEFINE_VISITABLE(XdmfGridCollection, XdmfGrid)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -114,7 +114,7 @@ public:
virtual ~XdmfMap();
LOKI_DEFINE_VISITABLE(XdmfMap, XdmfItem);
LOKI_DEFINE_VISITABLE(XdmfMap, XdmfItem)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -139,7 +139,7 @@ public:
virtual ~XdmfRectilinearGrid();
LOKI_DEFINE_VISITABLE(XdmfRectilinearGrid, XdmfGrid);
LOKI_DEFINE_VISITABLE(XdmfRectilinearGrid, XdmfGrid)
static const std::string ItemTag;
/**
......
......@@ -157,7 +157,7 @@ public:
virtual ~XdmfRegularGrid();
LOKI_DEFINE_VISITABLE(XdmfRegularGrid, XdmfGrid);
LOKI_DEFINE_VISITABLE(XdmfRegularGrid, XdmfGrid)
static const std::string ItemTag;
/**
......
......@@ -71,8 +71,8 @@ public:
virtual ~XdmfSet();
LOKI_DEFINE_VISITABLE(XdmfSet, XdmfArray);
XDMF_CHILDREN(XdmfSet, XdmfAttribute, Attribute, Name);
LOKI_DEFINE_VISITABLE(XdmfSet, XdmfArray)
XDMF_CHILDREN(XdmfSet, XdmfAttribute, Attribute, Name)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -61,7 +61,7 @@ public:
virtual ~XdmfTime();
LOKI_DEFINE_VISITABLE(XdmfTime, XdmfItem);
LOKI_DEFINE_VISITABLE(XdmfTime, XdmfItem)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -79,7 +79,7 @@ public:
virtual ~XdmfTopology();
LOKI_DEFINE_VISITABLE(XdmfTopology, XdmfArray);
LOKI_DEFINE_VISITABLE(XdmfTopology, XdmfArray)
static const std::string ItemTag;
std::map<std::string, std::string> getItemProperties() const;
......
......@@ -21,7 +21,6 @@
/* */
/*****************************************************************************/
#include <boost/assign.hpp>
#include <boost/tokenizer.hpp>
#include <limits>
#include <sstream>
......@@ -706,13 +705,23 @@ XdmfArray::getItemTag() const
std::string
XdmfArray::getName() const
{
return mName;
if (mName.c_str() == NULL) {
return "";
}
else {
return mName;
}
}
XdmfArray::ReadMode
XdmfArray::getReadMode() const
{
return mReadMode;
if (mReadMode) {
return mReadMode;
}
else {
return XdmfArray::Controller;
}
}
unsigned int
......@@ -725,7 +734,13 @@ XdmfArray::getSize() const
shared_ptr<XdmfArrayReference>
XdmfArray::getReference()
{
return mReference;
if (mReference) {
return mReference;
}
else {
// Returning arbitrary Reference since one isn't defined
return shared_ptr<XdmfArrayReference>();
}
}
void *
......@@ -1246,11 +1261,18 @@ XdmfArray::readController()
returnDimensions.push_back(dimTotal/controllerDimensionSubtotal);
mDimensions = returnDimensions;
}
else if (mHeavyDataControllers.size() == 1) {
else if (mHeavyDataControllers.size() == 1 && mHeavyDataControllers[0]->getArrayOffset() == 0) {
this->release();
mHeavyDataControllers[0]->read(this);
mDimensions = mHeavyDataControllers[0]->getDimensions();
}
else if (mHeavyDataControllers.size() == 1 && mHeavyDataControllers[0]->getArrayOffset() > 0) {
this->release();
shared_ptr<XdmfArray> tempArray = XdmfArray::New();
mHeavyDataControllers[0]->read(tempArray.get());
this->insert(mHeavyDataControllers[0]->getArrayOffset(), tempArray, 0, mHeavyDataControllers[0]->getSize(), 1, 1);
mDimensions = mHeavyDataControllers[0]->getDimensions();
}
}
void
......@@ -1289,7 +1311,12 @@ XdmfArray::setHeavyDataController(shared_ptr<XdmfHeavyDataController> newControl
void
XdmfArray::setName(const std::string & name)
{
mName = name;
if (mName.c_str() == NULL) {
XdmfError::message(XdmfError::FATAL, "Error: Internal Name String is a null reference");
}
else {
mName = name;
}
}
void
......
......@@ -128,8 +128,8 @@ public:
virtual ~XdmfArray();
LOKI_DEFINE_VISITABLE(XdmfArray, XdmfItem);
XDMF_CHILDREN(XdmfArray, XdmfHeavyDataController, HeavyDataController, Name);
LOKI_DEFINE_VISITABLE(XdmfArray, XdmfItem)
XDMF_CHILDREN(XdmfArray, XdmfHeavyDataController, HeavyDataController, Name)
static const std::string ItemTag;
/**
......@@ -316,7 +316,7 @@ public:
*
* @return A string containing the name of the array.
*/
std::string getName() const;
virtual std::string getName() const;
/**
* Gets the method this array will be written/read.
......@@ -1218,7 +1218,7 @@ public:
*
* @param name Name of the array to set.
*/
void setName(const std::string & name);
virtual void setName(const std::string & name);
/**
* Sets the method this array will be written/read.
......
......@@ -46,9 +46,14 @@ XdmfArrayReference::getConstructedProperties()
}
std::string
XdmfArrayReference::getConstructedType()
XdmfArrayReference::getConstructedType() const
{
return mConstructedType;
if (mConstructedType.c_str() != NULL) {
return mConstructedType;
}
else {
return "";
}
}
void
......
......@@ -43,7 +43,7 @@ public:
virtual ~XdmfArrayReference();
LOKI_DEFINE_VISITABLE(XdmfArrayReference, XdmfItem);
LOKI_DEFINE_VISITABLE(XdmfArrayReference, XdmfItem)
/**
* Gets the properties of the array that the reference will generate when read from file.
......@@ -101,7 +101,7 @@ public:
*
* @return The tag of the type to be generated
*/
std::string getConstructedType();
std::string getConstructedType() const;
/**
* Parses the reference and generates an array containing the values that
......@@ -127,7 +127,7 @@ public:
*
* @return The array generated by the reference
*/
virtual shared_ptr<XdmfArray> read() = 0;
virtual shared_ptr<XdmfArray> read() const = 0;
/**
* Sets the properties of array that the reference will generate when read from file.
......
......@@ -30,84 +30,86 @@
shared_ptr<const XdmfArrayType>
XdmfArrayType::Uninitialized()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("None", 0));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("None", 0, XdmfArrayType::Unsigned));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::Int8()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Char", 1));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Char", 1, XdmfArrayType::Signed));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::Int16()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Short", 2));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Short", 2, XdmfArrayType::Signed));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::Int32()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Int", 4));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Int", 4, XdmfArrayType::Signed));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::Int64()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Int", 8));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Int", 8, XdmfArrayType::Signed));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::Float32()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Float", 4));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Float", 4, XdmfArrayType::Float));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::Float64()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Float", 8));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("Float", 8, XdmfArrayType::Float));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::UInt8()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("UChar", 1));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("UChar", 1, XdmfArrayType::Unsigned));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::UInt16()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("UShort", 2));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("UShort", 2, XdmfArrayType::Unsigned));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::UInt32()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("UInt", 4));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("UInt", 4, XdmfArrayType::Unsigned));
return p;
}
shared_ptr<const XdmfArrayType>
XdmfArrayType::String()
{
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("String", 0));
static shared_ptr<const XdmfArrayType> p(new XdmfArrayType("String", 0, XdmfArrayType::Unsigned));
return p;
}
XdmfArrayType::XdmfArrayType(const std::string & name,
const unsigned int precision) :
const unsigned int precision,
const Format typeFormat) :
mName(name),
mPrecision(precision)
mPrecision(precision),
mTypeFormat(typeFormat)
{
std::stringstream precisionString;
precisionString << precision;
......@@ -374,6 +376,29 @@ XdmfArrayType::getName() const
return mName;
}
bool
XdmfArrayType::getIsFloat() const
{
if (mTypeFormat == XdmfArrayType::Float) {
return true;
}
else {
return false;
}
}
bool
XdmfArrayType::getIsSigned() const
{
if (mTypeFormat == XdmfArrayType::Float ||
mTypeFormat == XdmfArrayType::Signed) {
return true;
}
else {
return false;
}
}
void
XdmfArrayType::getProperties(std::map<std::string, std::string> & collectedProperties) const
{
......
......@@ -71,6 +71,12 @@ public:
friend class XdmfArray;
enum Format {
Unsigned,
Signed,
Float
};
// Supported XdmfArrayTypes
static shared_ptr<const XdmfArrayType> Uninitialized();
static shared_ptr<const XdmfArrayType> Int8();
......@@ -148,6 +154,48 @@ public:
*/
std::string getName() const;
/**
* Gets whether the data type is floating point or not.
*
* Example of use:
*
* C++
*
* @dontinclude ExampleXdmfArrayType.cpp
* @skipline //#getIsFloat
* @until //#getIsFloat
*
* Python
*
* @dontinclude XdmfExampleArrayType.py
* @skipline #//getIsFloat
* @until #//getIsFloat
*
* @return Whether the data type is signed.
*/
bool getIsFloat() const;
/**
* Gets whether the data type is signed or not.
*
* Example of use:
*
* C++
*
* @dontinclude ExampleXdmfArrayType.cpp
* @skipline //#getIsSigned
* @until //#getIsSigned
*
* Python
*
* @dontinclude XdmfExampleArrayType.py
* @skipline #//getIsSigned
* @until #//getIsSigned
*
* @return Whether the data type is signed.
*/
bool getIsSigned() const;
void
getProperties(std::map<std::string, std::string> & collectedProperties) const;
......@@ -164,7 +212,8 @@ protected:
* construct.
*/
XdmfArrayType(const std::string & name,
const unsigned int precision);
const unsigned int precision,
const Format typeFormat);
private:
......@@ -177,6 +226,7 @@ private:
const std::string mName;
const unsigned int mPrecision;
std::string mPrecisionString;
Format mTypeFormat;
};
#endif /* XDMFARRAYTYPE_HPP_ */
......@@ -288,10 +288,29 @@ swig -v -c++ -python -o XdmfCorePython.cpp XdmfCore.i
}
};
%extend XdmfHeavyDataController {
static shared_ptr<XdmfHDF5Controller> XdmfHDF5ControllerCast(PyObject * obj)
{
void * resultPointer = 0;
swig_type_info * returnType = SWIG_TypeQuery("_p_boost__shared_ptrT_XdmfHeavyDataController_t");
SWIG_ConvertPtr(obj, &resultPointer, returnType, 0);
shared_ptr<XdmfHeavyDataController> * returnControllerPointer =
reinterpret_cast<shared_ptr<XdmfHeavyDataController> *>(resultPointer);
shared_ptr<XdmfHeavyDataController> returnController = returnControllerPointer[0];
if (shared_ptr<XdmfHDF5Controller> returnHDF5Controller = shared_dynamic_cast<XdmfHDF5Controller>(returnController)) {
return returnHDF5Controller;
}
else {
XdmfError::message(XdmfError::FATAL, "Error: Attempting to cast a non HDF5 Controller to HDF5");
return shared_ptr<XdmfHDF5Controller>();
}
}
};
/*This causes it to avoid throwing a warning for redefining fuctions that are defined for XdmfArray.
I do this because doing so was intentional.*/
#pragma SWIG nowarn=302
/*Warnint 325 is due to having nested classes in XdmfFunction that are not accessible when wrapped.
/*Warning 325 is due to having nested classes in XdmfFunction that are not accessible when wrapped.
As of right now, this is acceptable behavior. So, the warning is suppressed*/
#pragma SWIG nowarn=325
......
......@@ -26,6 +26,8 @@
#include "XdmfError.hpp"
#include "XdmfFunction.hpp"
#include "XdmfSubset.hpp"
#include "XdmfInformation.hpp"
#include "XdmfSparseMatrix.hpp"
#include <boost/tokenizer.hpp>
XdmfCoreItemFactory::XdmfCoreItemFactory()
......@@ -74,8 +76,11 @@ XdmfCoreItemFactory::createItem(const std::string & itemTag,
try {
shared_ptr<XdmfArray> tempArray =
shared_dynamic_cast<XdmfArray>(childItems[i]);
variableCollection[tempArray->getName()] = tempArray;
tempArray->read();
if (tempArray->getName().compare("") != 0)
{
variableCollection[tempArray->getName()] = tempArray;
tempArray->read();
}
}
catch (...) {
XdmfError::message(XdmfError::FATAL,
......@@ -167,7 +172,22 @@ XdmfCoreItemFactory::createItem(const std::string & itemTag,
dimensionVector.push_back(atoi((*iter).c_str()));
}
referenceArray = shared_dynamic_cast<XdmfArray>(childItems[0]);
bool foundspacer = false;
for(std::vector<shared_ptr<XdmfItem> >::const_iterator iter =
childItems.begin();
iter != childItems.end();
++iter) {
if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) {
if (foundspacer) {
referenceArray = shared_dynamic_cast<XdmfArray>(array);
break;
}
else {
foundspacer = true;
}
}
}
shared_ptr<XdmfSubset> newSubset = XdmfSubset::New(referenceArray,
startVector,
......
......@@ -36,6 +36,8 @@
#include "XdmfCoreItemFactory.hpp"
#include "XdmfCoreReader.hpp"
#include "XdmfError.hpp"
#include "XdmfFunction.hpp"
#include "XdmfSubset.hpp"
#include "XdmfItem.hpp"
#include "XdmfSystemUtils.hpp"
......@@ -156,7 +158,7 @@ public:
}
currAttribute = currAttribute->next;
}
xmlXPathContextPtr oldContext = mXPathContext;
if(href) {
xmlDocPtr document;
......@@ -211,8 +213,11 @@ public:
std::map<std::string, std::string> itemProperties;
xmlNodePtr childNode = currNode->children;
// generate content if an array or arrayReference
if (XdmfArray::ItemTag.compare((char *)currNode->name) == 0 ||
strcmp("DataStructure", (char *)currNode->name) == 0) {
strcmp("DataStructure", (char *)currNode->name) == 0 ||
XdmfFunction::ItemTag.compare((char *)currNode->name) == 0 ||
XdmfSubset::ItemTag.compare((char *)currNode->name) == 0) {
while(childNode != NULL) {
if(childNode->type == XML_TEXT_NODE && childNode->content) {
......@@ -253,16 +258,9 @@ public:
// Populate built XdmfItem
if (newItem->getItemTag().compare((const char *)currNode->name) != 0) {
newItem->populateItem(itemProperties,
std::vector<shared_ptr<XdmfItem> >(),
mCoreReader);
}
else {
newItem->populateItem(itemProperties,
childItems,
mCoreReader);
}
newItem->populateItem(itemProperties,
childItems,
mCoreReader);
myItems.push_back(newItem);
mXPathMap.insert(std::make_pair(currNode, newItem));
......@@ -306,6 +304,9 @@ XdmfCoreReader::~XdmfCoreReader()
shared_ptr<XdmfItem >
XdmfCoreReader::parse(const std::string & lightData) const
{
if (mImpl == NULL) {
XdmfError::message(XdmfError::FATAL, "Error: Reader Internal Object is NULL");
}
mImpl->parse(lightData);
const xmlNodePtr currNode = xmlDocGetRootElement(mImpl->mDocument);
std::vector<shared_ptr<XdmfItem> > toReturn;
......@@ -324,6 +325,9 @@ XdmfCoreReader::parse(const std::string & lightData) const
std::vector<shared_ptr<XdmfItem> >
XdmfCoreReader::readItems(const std::string & filePath) const
{
if (mImpl == NULL) {
XdmfError::message(XdmfError::FATAL, "Error: Reader Internal Object is NULL");
}
mImpl->openFile(filePath);
const xmlNodePtr currNode = xmlDocGetRootElement(mImpl->mDocument);
const std::vector<shared_ptr<XdmfItem> > toReturn =
......@@ -346,6 +350,9 @@ std::vector<shared_ptr<XdmfItem> >
XdmfCoreReader::read(const std::string & filePath,
const std::string & xPath) const
{
if (mImpl == NULL) {
XdmfError::message(XdmfError::FATAL, "Error: Reader Internal Object is NULL");
}
mImpl->openFile(filePath);
std::vector<shared_ptr<XdmfItem> > toReturn = this->readPathObjects(xPath);
mImpl->closeFile();
......@@ -355,6 +362,9 @@ XdmfCoreReader::read(const std::string & filePath,
std::vector<shared_ptr<XdmfItem> >
XdmfCoreReader::readPathObjects(const std::string & xPath) const
{
if (mImpl == NULL) {
XdmfError::message(XdmfError::FATAL, "Error: Reader Internal Object is NULL");
}
std::vector<shared_ptr<XdmfItem> > toReturn;
mImpl->readPathObjects(xPath, toReturn);
return toReturn;
......
......@@ -17,7 +17,7 @@ XdmfError::~XdmfError() throw()
************************/
XdmfError::Level
XdmfError::getLevel()
XdmfError::getLevel() const
{
return XdmfError::mLevel;
}
......@@ -89,8 +89,10 @@ XdmfError::setBuffer(std::streambuf* buf)
void
XdmfError::WriteToStream(std::string msg)
{
if(msg[msg.length()-1] != '\n')
msg+='\n';
if(msg[msg.length()-1] != '\n') {
// using \r\n for windows compatiblity
msg+="\r\n";
}
XdmfError::mBuf->sputn(msg.c_str(),msg.length());