Commit 8e39bc04 authored by David E. DeMarle's avatar David E. DeMarle

Revert the removal of boost changes

it breaks windows and some of Xdmf's own tests

Revert "removed a PARENT_SCOPE that was unessesary, added some missing includes, fixed cxx11 typecasting"
This reverts commit 583c14de.

Revert "changes to fix windows build"
This reverts commit 397e235f.

Revert "Updates to reduce library files needed for linking"
This reverts commit ff194c1f.

Revert "adjusting code away from regex to handle Apple systems"
This reverts commit 05124fbf.

Revert "Fixed typo"
This reverts commit bba7984f.

Revert "std::string compatibility"
This reverts commit 24ea357e.

Revert "fixes to handle boost not being available"
This reverts commit b21b735a.

Revert "removed print statement"
This reverts commit 44d1df0e.

Revert "Fixed typo in PushBack change"
This reverts commit 61df7337.

Revert "fixes for Windows Compilation"
This reverts commit 92313779.

Revert "Changes to remove boost dependency and add Cxx11 as an alternate"
This reverts commit f5300338.
parent 5d1e9713
...@@ -79,17 +79,13 @@ ENDMACRO() ...@@ -79,17 +79,13 @@ ENDMACRO()
# Output: # Output:
# is_core = variable is set to 'Core' is core was found in dir # is_core = variable is set to 'Core' is core was found in dir
MACRO(SET_CORE dir) MACRO(SET_CORE dir)
IF(NOT "${XDMF_SUBSECTION}" STREQUAL "") STRING(REGEX MATCH "core" is_core "${dir}")
set(is_core ${XDMF_SUBSECTION}) IF(EXISTS ${is_core})
ELSE() SET(is_core "Core")
STRING(REGEX MATCH "core" is_core "${dir}") ELSE(EXISTS ${is_core})
STRING(REGEX MATCH "utils" is_core "${dir}")
IF(EXISTS ${is_core}) IF(EXISTS ${is_core})
SET(is_core "Core") SET(is_core "Util")
ELSE(EXISTS ${is_core})
STRING(REGEX MATCH "utils" is_core "${dir}")
IF(EXISTS ${is_core})
SET(is_core "Util")
ENDIF(EXISTS ${is_core})
ENDIF(EXISTS ${is_core}) ENDIF(EXISTS ${is_core})
ENDIF(NOT "${XDMF_SUBSECTION}" STREQUAL "") ENDIF(EXISTS ${is_core})
ENDMACRO(SET_CORE dir) ENDMACRO(SET_CORE dir)
...@@ -12,8 +12,6 @@ if(MSVC10) ...@@ -12,8 +12,6 @@ if(MSVC10)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
endif() endif()
include(CheckCXXSourceCompiles)
set(XDMF_LIBNAME "Xdmf" CACHE STRING "Name for this xdmf library to avoid collision") set(XDMF_LIBNAME "Xdmf" CACHE STRING "Name for this xdmf library to avoid collision")
set(XDMF_MAJOR_VERSION 3) set(XDMF_MAJOR_VERSION 3)
...@@ -50,7 +48,6 @@ if (XDMF_STATIC_AND_SHARED) ...@@ -50,7 +48,6 @@ if (XDMF_STATIC_AND_SHARED)
endif () endif ()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/CMake/VersionSuite)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH list(APPEND CMAKE_MODULE_PATH
...@@ -103,33 +100,6 @@ endif (TIFF_FOUND) ...@@ -103,33 +100,6 @@ endif (TIFF_FOUND)
# Test for DSM # Test for DSM
option(XDMF_BUILD_DSM OFF) option(XDMF_BUILD_DSM OFF)
mark_as_advanced(XDMF_BUILD_DSM) mark_as_advanced(XDMF_BUILD_DSM)
option(XDMF_TRY_NOBOOST ON)
mark_as_advanced(XDMF_TRY_NOBOOST)
if (XDMF_TRY_NOBOOST)
# Test for Cxx11
unset(HAVE_CXX11_SHARED_PTR CACHE)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
endif ()
# Cxx11 does not work with swig due to an issue with swig
if (HAVE_CXX11_SHARED_PTR AND NOT XDMF_WRAP_PYTHON)
add_definitions(-DHAVE_CXX11_SHARED_PTR)
endif ()
if(XDMF_BUILD_DSM) if(XDMF_BUILD_DSM)
find_package(MPI REQUIRED) find_package(MPI REQUIRED)
if(MPI_FOUND) if(MPI_FOUND)
...@@ -403,15 +373,7 @@ if(NOT XDMF_BUILD_CORE_ONLY) ...@@ -403,15 +373,7 @@ if(NOT XDMF_BUILD_CORE_ONLY)
) )
endif (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS)
else() else()
if (WIN32) add_library(${XDMF_LIBNAME} ${LIBTYPE} ${XdmfSources})
if (XDMF_BUILD_DSM)
add_library(${XDMF_LIBNAME} ${LIBTYPE} ${XdmfSources} ${XdmfCoreSources} ${XdmfDSMSources})
else ()
add_library(${XDMF_LIBNAME} ${LIBTYPE} ${XdmfSources} ${XdmfCoreSources})
endif ()
else ()
add_library(${XDMF_LIBNAME} ${LIBTYPE} ${XdmfSources})
endif ()
endif() endif()
SET_TARGET_PROPERTIES( SET_TARGET_PROPERTIES(
${XDMF_LIBNAME} PROPERTIES ${XDMF_LIBNAME} PROPERTIES
......
...@@ -142,28 +142,22 @@ ...@@ -142,28 +142,22 @@
# define XDMF_TEMPLATE # define XDMF_TEMPLATE
#else #else
/* Used to export/import from the dlls */ /* Used to export/import from the dlls */
# undef XDMFCORE_EXPORT
# define XDMFCORE_EXPORT __declspec(dllimport)
# undef XDMFCORE_TEMPLATE
# define XDMFCORE_TEMPLATE extern
# undef XDMFDSM_EXPORT
# define XDMFDSM_EXPORT __declspec(dllimport)
# undef XDMFDSM_TEMPLATE
# define XDMFDSM_TEMPLATE extern
# ifdef XDMF_EXPORTS # ifdef XDMF_EXPORTS
# define XDMF_EXPORT __declspec(dllexport) # define XDMF_EXPORT __declspec(dllexport)
# define XDMF_TEMPLATE # define XDMF_TEMPLATE
# undef XDMFCORE_EXPORT
# define XDMFCORE_EXPORT __declspec(dllexport)
# undef XDMFCORE_TEMPLATE
# define XDMFCORE_TEMPLATE
# undef XDMFDSM_EXPORT
# define XDMFDSM_EXPORT __declspec(dllexport)
# undef XDMFDSM_TEMPLATE
# define XDMFDSM_TEMPLATE
# else /* XDMF_EXPORTS */ # else /* XDMF_EXPORTS */
# define XDMF_EXPORT __declspec(dllimport) # define XDMF_EXPORT __declspec(dllimport)
# define XDMF_TEMPLATE extern # define XDMF_TEMPLATE extern
# undef XDMFCORE_EXPORT
# define XDMFCORE_EXPORT __declspec(dllimport)
# undef XDMFCORE_TEMPLATE
# define XDMFCORE_TEMPLATE extern
# undef XDMFDSM_EXPORT
# define XDMFDSM_EXPORT __declspec(dllimport)
# undef XDMFDSM_TEMPLATE
# define XDMFDSM_TEMPLATE extern
# endif /* XDMF_EXPORTS */ # endif /* XDMF_EXPORTS */
#endif #endif
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <numeric> #include <numeric>
#include <functional> #include <functional>
#include <boost/tokenizer.hpp>
#include "XdmfArray.hpp" #include "XdmfArray.hpp"
#include "XdmfError.hpp" #include "XdmfError.hpp"
#include "XdmfAggregate.hpp" #include "XdmfAggregate.hpp"
......
...@@ -114,7 +114,11 @@ XdmfAttribute::populateItem(const std::map<std::string, std::string> & itemPrope ...@@ -114,7 +114,11 @@ XdmfAttribute::populateItem(const std::map<std::string, std::string> & itemPrope
iter != childItems.end(); iter != childItems.end();
++iter) { ++iter) {
if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) { if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) {
this->populateArray(array); this->swap(array);
if (array->getReference()) {
this->setReference(array->getReference());
this->setReadMode(XdmfArray::Reference);
}
break; break;
} }
} }
......
...@@ -276,7 +276,7 @@ XdmfCurvilinearGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid) ...@@ -276,7 +276,7 @@ XdmfCurvilinearGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid)
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfCurvilinearGrid::getDimensions() XdmfCurvilinearGrid::getDimensions()
{ {
return const_pointer_cast<XdmfArray> return boost::const_pointer_cast<XdmfArray>
(static_cast<const XdmfCurvilinearGrid &>(*this).getDimensions()); (static_cast<const XdmfCurvilinearGrid &>(*this).getDimensions());
} }
...@@ -289,7 +289,7 @@ XdmfCurvilinearGrid::getDimensions() const ...@@ -289,7 +289,7 @@ XdmfCurvilinearGrid::getDimensions() const
shared_ptr<XdmfGeometry> shared_ptr<XdmfGeometry>
XdmfCurvilinearGrid::getGeometry() XdmfCurvilinearGrid::getGeometry()
{ {
return const_pointer_cast<XdmfGeometry> return boost::const_pointer_cast<XdmfGeometry>
(static_cast<const XdmfGrid &>(*this).getGeometry()); (static_cast<const XdmfGrid &>(*this).getGeometry());
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "XdmfGeometryType.hpp" #include "XdmfGeometryType.hpp"
#include "XdmfError.hpp" #include "XdmfError.hpp"
#include "XdmfFunction.hpp" #include "XdmfFunction.hpp"
#include <cstring> #include <boost/tokenizer.hpp>
shared_ptr<XdmfGeometry> XdmfGeometry::New() shared_ptr<XdmfGeometry> XdmfGeometry::New()
{ {
...@@ -176,7 +176,11 @@ XdmfGeometry::populateItem(const std::map<std::string, std::string> & itemProper ...@@ -176,7 +176,11 @@ XdmfGeometry::populateItem(const std::map<std::string, std::string> & itemProper
iter != childItems.end(); iter != childItems.end();
++iter) { ++iter) {
if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) { if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) {
this->populateArray(array); this->swap(array);
if (array->getReference()) {
this->setReference(array->getReference());
this->setReadMode(XdmfArray::Reference);
}
break; break;
} }
} }
...@@ -191,25 +195,12 @@ XdmfGeometry::populateItem(const std::map<std::string, std::string> & itemProper ...@@ -191,25 +195,12 @@ XdmfGeometry::populateItem(const std::map<std::string, std::string> & itemProper
std::map<std::string, std::string>::const_iterator origin = std::map<std::string, std::string>::const_iterator origin =
itemProperties.find("Origin"); itemProperties.find("Origin");
if (origin != itemProperties.end()) { if (origin != itemProperties.end()) {
#ifdef HAVE_CXX11_SHARED_PTR
char * originString = strdup(origin->second.c_str());
char * token = std::strtok(originString, " ");
while (token != NULL)
{
mOrigin.push_back(atof(token));
token = std::strtok(NULL, " ");
}
free(originString);
originString = NULL;
#else
boost::tokenizer<> tokens(origin->second); boost::tokenizer<> tokens(origin->second);
for(boost::tokenizer<>::const_iterator iter = tokens.begin(); for(boost::tokenizer<>::const_iterator iter = tokens.begin();
iter != tokens.end(); iter != tokens.end();
++iter) { ++iter) {
mOrigin.push_back(atof((*iter).c_str())); mOrigin.push_back(atof((*iter).c_str()));
} }
#endif
} }
} }
......
...@@ -62,7 +62,7 @@ XdmfGraph::getItemTag() const ...@@ -62,7 +62,7 @@ XdmfGraph::getItemTag() const
shared_ptr<XdmfTime> shared_ptr<XdmfTime>
XdmfGraph::getTime() XdmfGraph::getTime()
{ {
return const_pointer_cast<XdmfTime> return boost::const_pointer_cast<XdmfTime>
(static_cast<const XdmfGraph &>(*this).getTime()); (static_cast<const XdmfGraph &>(*this).getTime());
} }
......
...@@ -141,7 +141,7 @@ XdmfGrid::getName() const ...@@ -141,7 +141,7 @@ XdmfGrid::getName() const
shared_ptr<XdmfTime> shared_ptr<XdmfTime>
XdmfGrid::getTime() XdmfGrid::getTime()
{ {
return const_pointer_cast<XdmfTime> return boost::const_pointer_cast<XdmfTime>
(static_cast<const XdmfGrid &>(*this).getTime()); (static_cast<const XdmfGrid &>(*this).getTime());
} }
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include "XdmfSystemUtils.hpp" #include "XdmfSystemUtils.hpp"
#include <boost/tokenizer.hpp>
#include <stdio.h> #include <stdio.h>
shared_ptr<XdmfGridTemplate> shared_ptr<XdmfGridTemplate>
......
...@@ -21,9 +21,8 @@ ...@@ -21,9 +21,8 @@
/* */ /* */
/*****************************************************************************/ /*****************************************************************************/
#include <algorithm>
#include <cctype> #include <cctype>
#include <cstring> #include <boost/tokenizer.hpp>
#include "XdmfAttribute.hpp" #include "XdmfAttribute.hpp"
#include "XdmfCurvilinearGrid.hpp" #include "XdmfCurvilinearGrid.hpp"
#include "XdmfDomain.hpp" #include "XdmfDomain.hpp"
...@@ -278,25 +277,12 @@ XdmfItemFactory::createItem(const std::string & itemTag, ...@@ -278,25 +277,12 @@ XdmfItemFactory::createItem(const std::string & itemTag,
if(dimensions != itemProperties.end()) { if(dimensions != itemProperties.end()) {
dimensionsString = dimensions->second; dimensionsString = dimensions->second;
} }
#ifdef HAVE_CXX11_SHARED_PTR
char * dimString = strdup(dimensionsString.c_str());
char * token = std::strtok(dimString, " ");
while (token != NULL)
{
dimensionsArray->pushBack(atoi(token));
token = std::strtok(NULL, " ");
}
free(dimString);
dimString = NULL;
#else
boost::tokenizer<> tokens(dimensionsString); boost::tokenizer<> tokens(dimensionsString);
for(boost::tokenizer<>::const_iterator iter = tokens.begin(); for(boost::tokenizer<>::const_iterator iter = tokens.begin();
iter != tokens.end(); iter != tokens.end();
++iter) { ++iter) {
dimensionsArray->pushBack<unsigned int>(atoi((*iter).c_str())); dimensionsArray->pushBack<unsigned int>(atoi((*iter).c_str()));
} }
#endif
if(typeVal.compare("2DCORECTMESH") == 0 || if(typeVal.compare("2DCORECTMESH") == 0 ||
typeVal.compare("3DCORECTMESH") == 0 || typeVal.compare("3DCORECTMESH") == 0 ||
typeVal.compare("CORECTMESH") == 0) { typeVal.compare("CORECTMESH") == 0) {
......
...@@ -333,7 +333,7 @@ XdmfRectilinearGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid) ...@@ -333,7 +333,7 @@ XdmfRectilinearGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid)
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfRectilinearGrid::getCoordinates(const unsigned int axisIndex) XdmfRectilinearGrid::getCoordinates(const unsigned int axisIndex)
{ {
return const_pointer_cast<XdmfArray> return boost::const_pointer_cast<XdmfArray>
(static_cast<const XdmfRectilinearGrid &> (static_cast<const XdmfRectilinearGrid &>
(*this).getCoordinates(axisIndex)); (*this).getCoordinates(axisIndex));
} }
...@@ -362,7 +362,7 @@ XdmfRectilinearGrid::getCoordinates() const ...@@ -362,7 +362,7 @@ XdmfRectilinearGrid::getCoordinates() const
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfRectilinearGrid::getDimensions() XdmfRectilinearGrid::getDimensions()
{ {
return const_pointer_cast<XdmfArray> return boost::const_pointer_cast<XdmfArray>
(static_cast<const XdmfRectilinearGrid &>(*this).getDimensions()); (static_cast<const XdmfRectilinearGrid &>(*this).getDimensions());
} }
......
...@@ -373,7 +373,7 @@ XdmfRegularGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid) ...@@ -373,7 +373,7 @@ XdmfRegularGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid)
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfRegularGrid::getBrickSize() XdmfRegularGrid::getBrickSize()
{ {
return const_pointer_cast<XdmfArray> return boost::const_pointer_cast<XdmfArray>
(static_cast<const XdmfRegularGrid &>(*this).getBrickSize()); (static_cast<const XdmfRegularGrid &>(*this).getBrickSize());
} }
...@@ -386,7 +386,7 @@ XdmfRegularGrid::getBrickSize() const ...@@ -386,7 +386,7 @@ XdmfRegularGrid::getBrickSize() const
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfRegularGrid::getDimensions() XdmfRegularGrid::getDimensions()
{ {
return const_pointer_cast<XdmfArray> return boost::const_pointer_cast<XdmfArray>
(static_cast<const XdmfRegularGrid &>(*this).getDimensions()); (static_cast<const XdmfRegularGrid &>(*this).getDimensions());
} }
...@@ -399,7 +399,7 @@ XdmfRegularGrid::getDimensions() const ...@@ -399,7 +399,7 @@ XdmfRegularGrid::getDimensions() const
shared_ptr<XdmfArray> shared_ptr<XdmfArray>
XdmfRegularGrid::getOrigin() XdmfRegularGrid::getOrigin()
{ {
return const_pointer_cast<XdmfArray> return boost::const_pointer_cast<XdmfArray>
(static_cast<const XdmfRegularGrid &>(*this).getOrigin()); (static_cast<const XdmfRegularGrid &>(*this).getOrigin());
} }
......
...@@ -107,7 +107,7 @@ XdmfSet::populateItem(const std::map<std::string, std::string> & itemProperties, ...@@ -107,7 +107,7 @@ XdmfSet::populateItem(const std::map<std::string, std::string> & itemProperties,
else if(shared_ptr<XdmfArray> array = else if(shared_ptr<XdmfArray> array =
shared_dynamic_cast<XdmfArray>(*iter)) { shared_dynamic_cast<XdmfArray>(*iter)) {
if (!filled) { if (!filled) {
this->populateArray(array); this->swap(array);
filled = true; filled = true;
} }
if (array->getReference()) { if (array->getReference()) {
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <sstream> #include <sstream>
#include <utility> #include <utility>
#include <climits> #include <climits>
#include <cstring>
#include <set> #include <set>
#include "XdmfArray.hpp" #include "XdmfArray.hpp"
#include "XdmfHDF5Controller.hpp" #include "XdmfHDF5Controller.hpp"
...@@ -39,6 +38,8 @@ ...@@ -39,6 +38,8 @@
#include "XdmfSystemUtils.hpp" #include "XdmfSystemUtils.hpp"
#include <boost/tokenizer.hpp>
#include <stdio.h> #include <stdio.h>
std::vector<shared_ptr<XdmfHeavyDataController> > std::vector<shared_ptr<XdmfHeavyDataController> >
...@@ -887,9 +888,7 @@ XdmfTemplate::preallocateSteps(unsigned int numSteps) ...@@ -887,9 +888,7 @@ XdmfTemplate::preallocateSteps(unsigned int numSteps)
//printf("allocating subsection %u\n", allocateIteration); //printf("allocating subsection %u\n", allocateIteration);
//*/ //*/
//printf("initializing base array\n"); //printf("initializing base array\n");
std::vector<unsigned int> preallocatedSizeVector; tempArray->initialize(mTrackedArrays[i]->getArrayType(), preallocatedSize);
preallocatedSizeVector.push_back(preallocatedSize);
tempArray->initialize(mTrackedArrays[i]->getArrayType(), preallocatedSizeVector);
//printf("writing subsection"); //printf("writing subsection");
tempArray->accept(mHeavyWriter); tempArray->accept(mHeavyWriter);
//printf("subsection written\n"); //printf("subsection written\n");
...@@ -1115,28 +1114,6 @@ XdmfTemplate::setStep(unsigned int stepId) ...@@ -1115,28 +1114,6 @@ XdmfTemplate::setStep(unsigned int stepId)
mTrackedArrays[i]->initialize(mTrackedArrayTypes[i], mTrackedArrayDims[i]); mTrackedArrays[i]->initialize(mTrackedArrayTypes[i], mTrackedArrayDims[i]);
unsigned int index = 0; unsigned int index = 0;
#ifdef HAVE_CXX11_SHARED_PTR
char * trackedString = strdup(content.c_str());
char * token = std::strtok(trackedString, " \t\n");
if(mTrackedArrayTypes[i] == XdmfArrayType::String()) {
while (token != NULL)
{
mTrackedArrays[i]->insert(index, std::string(token));
token = std::strtok(NULL, " \t\n");
++index;
}
}
else {
while (token != NULL)
{
mTrackedArrays[i]->insert(index, atof(token));
token = std::strtok(NULL, " \t\n");
++index;
}
}
free(trackedString);
trackedString = NULL;
#else
boost::char_separator<char> sep(" \t\n"); boost::char_separator<char> sep(" \t\n");
boost::tokenizer<boost::char_separator<char> > valtokens(content, sep); boost::tokenizer<boost::char_separator<char> > valtokens(content, sep);
if(mTrackedArrayTypes[i] == XdmfArrayType::String()) { if(mTrackedArrayTypes[i] == XdmfArrayType::String()) {
...@@ -1155,7 +1132,6 @@ XdmfTemplate::setStep(unsigned int stepId) ...@@ -1155,7 +1132,6 @@ XdmfTemplate::setStep(unsigned int stepId)
mTrackedArrays[i]->insert(index, atof((*iter).c_str())); mTrackedArrays[i]->insert(index, atof((*iter).c_str()));
} }
} }
#endif
} }
} }
} }
......
...@@ -158,7 +158,11 @@ XdmfTopology::populateItem(const std::map<std::string, std::string> & itemProper ...@@ -158,7 +158,11 @@ XdmfTopology::populateItem(const std::map<std::string, std::string> & itemProper
iter != childItems.end(); iter != childItems.end();
++iter) { ++iter) {
if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) { if(shared_ptr<XdmfArray> array = shared_dynamic_cast<XdmfArray>(*iter)) {
this->populateArray(array); this->swap(array);
if (array->getReference()) {
this->setReference(array->getReference());
this->setReadMode(XdmfArray::Reference);
}
break; break;
} }
} }
......
...@@ -259,7 +259,7 @@ XdmfUnstructuredGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid) ...@@ -259,7 +259,7 @@ XdmfUnstructuredGrid::copyGrid(shared_ptr<XdmfGrid> sourceGrid)
shared_ptr<XdmfGeometry> shared_ptr<XdmfGeometry>
XdmfUnstructuredGrid::getGeometry() XdmfUnstructuredGrid::getGeometry()
{ {
return const_pointer_cast<XdmfGeometry> return boost::const_pointer_cast<XdmfGeometry>
(static_cast<const XdmfGrid &>(*this).getGeometry()); (static_cast<const XdmfGrid &>(*this).getGeometry());
} }
...@@ -272,7 +272,7 @@ XdmfUnstructuredGrid::getItemTag() const ...@@ -272,7 +272,7 @@ XdmfUnstructuredGrid::getItemTag() const
shared_ptr<XdmfTopology> shared_ptr<XdmfTopology>
XdmfUnstructuredGrid::getTopology() XdmfUnstructuredGrid::getTopology()
{ {
return const_pointer_cast<XdmfTopology> return boost::const_pointer_cast<XdmfTopology>
(static_cast<const XdmfGrid &>(*this).getTopology()); (static_cast<const XdmfGrid &>(*this).getTopology());
} }
......
...@@ -39,7 +39,7 @@ if(XDMF_BUILD_DSM) ...@@ -39,7 +39,7 @@ if(XDMF_BUILD_DSM)
endif() endif()
mark_as_advanced(CLEAR Boost_INCLUDE_DIR) mark_as_advanced(CLEAR Boost_INCLUDE_DIR)
find_package(Boost) find_package(Boost REQUIRED)
if(Boost_FOUND) if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS})
mark_as_advanced(FORCE Boost_INCLUDE_DIR) mark_as_advanced(FORCE Boost_INCLUDE_DIR)
...@@ -117,8 +117,7 @@ endif() ...@@ -117,8 +117,7 @@ endif()
TEST_BIG_ENDIAN(XDMF_BIG_ENDIAN) TEST_BIG_ENDIAN(XDMF_BIG_ENDIAN)
unset(HAVE_BOOST_SHARED_DYNAMIC_CAST CACHE) unset(HAVE_BOOST_SHARED_DYNAMIC_CAST CACHE)
unset(HAVE_CXX11_SHARED_PTR CACHE) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${Boost_INCLUDE_DIRS})
check_cxx_source_compiles(" check_cxx_source_compiles("
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
...@@ -133,26 +132,6 @@ int main(int ac, char * av[]) ...@@ -133,26 +132,6 @@ int main(int ac, char * av[])
" "
HAVE_BOOST_SHARED_DYNAMIC_CAST) HAVE_BOOST_SHARED_DYNAMIC_CAST)
if (XDMF_TRY_NOBOOST)
check_cxx_source_compiles("
#include <memory>
using namespace std;
struct Base { virtual ~Base(){} };
int main(int ac, char * av[])
{
shared_ptr<Base> ptr(new Base());
}
"
HAVE_CXX11_SHARED_PTR)
endif ()
if (HAVE_CXX11_SHARED_PTR AND NOT XDMF_WRAP_PYTHON)
add_definitions(-DHAVE_CXX11_SHARED_PTR)
endif ()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/XdmfCoreConfig.hpp.in configure_file(${CMAKE_CURRENT_SOURCE_DIR}/XdmfCoreConfig.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/XdmfCoreConfig.hpp) ${CMAKE_CURRENT_BINARY_DIR}/XdmfCoreConfig.hpp)
...@@ -245,9 +224,6 @@ SET_TARGET_PROPERTIES( ...@@ -245,9 +224,6 @@ SET_TARGET_PROPERTIES(
SOVERSION ${XDMF_MAJOR_VERSION} SOVERSION ${XDMF_MAJOR_VERSION}
) )
set(XDMF_LIBRARY_DIRS ${XDMF_LIBRARY_DIRS} PARENT_SCOPE)
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} PARENT_SCOPE)
link_directories(${XDMF_LIBRARY_DIRS}) link_directories(${XDMF_LIBRARY_DIRS})
target_link_libraries(XdmfCore ${XDMF_LIBRARIES}) target_link_libraries(XdmfCore ${XDMF_LIBRARIES})
...@@ -350,6 +326,7 @@ set(XdmfCore_INCLUDE_DIRS ...@@ -350,6 +326,7 @@ set(XdmfCore_INCLUDE_DIRS
CACHE INTERNAL "") CACHE INTERNAL "")
set(XDMF_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include PARENT_SCOPE) set(XDMF_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include PARENT_SCOPE)
set(XDMF_LIBRARIES ${XDMF_LIBRARIES} ${CMAKE_INSTALL_PREFIX}/lib)
set(XDMF_DIR ${CMAKE_INSTALL_PREFIX} PARENT_SCOPE) set(XDMF_DIR ${CMAKE_INSTALL_PREFIX} PARENT_SCOPE)
set(XDMF_BINARIES ${XDMF_BINARIES} ${CMAKE_INSTALL_PREFIX}/bin) set(XDMF_BINARIES ${XDMF_BINARIES} ${CMAKE_INSTALL_PREFIX}/bin)
......
This diff is collapsed.
...@@ -37,6 +37,8 @@ class XdmfArrayType; ...@@ -37,6 +37,8 @@ class XdmfArrayType;
class XdmfHeavyDataController; class XdmfHeavyDataController;
// Includes // Includes
#include <boost/shared_array.hpp>
#include <boost/variant.hpp>
/** /**
* @brief Provides storage for data values that are read in or will be * @brief Provides storage for data values that are read in or will be
...@@ -108,11 +110,6 @@ public: ...@@ -108,11 +110,6 @@ public:
Reference Reference
}; };
friend class XdmfHeavyDataWriter;
friend class XdmfHDF5Writer;