Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xdmf
Xdmf
Commits
ef98c862
Commit
ef98c862
authored
May 28, 2010
by
Kenneth Leiter
Browse files
ENH: Clean up a bit of const-correctness related things.
parent
94f61d16
Changes
22
Hide whitespace changes
Inline
Side-by-side
XdmfArray.cpp
View file @
ef98c862
...
...
@@ -691,12 +691,12 @@ void XdmfArray::reserve(const unsigned int size)
}
}
void
XdmfArray
::
setHDF5Controller
(
boost
::
shared_ptr
<
XdmfHDF5Controller
>
hdf5Controller
)
void
XdmfArray
::
setHDF5Controller
(
const
boost
::
shared_ptr
<
XdmfHDF5Controller
>
hdf5Controller
)
{
mHDF5Controller
=
hdf5Controller
;
}
void
XdmfArray
::
swap
(
boost
::
shared_ptr
<
XdmfArray
>
array
)
void
XdmfArray
::
swap
(
const
boost
::
shared_ptr
<
XdmfArray
>
array
)
{
ArrayVariant
tmpArray
=
array
->
mArray
;
ArrayPointerVariant
tmpArrayPointer
=
array
->
mArrayPointer
;
...
...
XdmfArray.hpp
View file @
ef98c862
...
...
@@ -163,7 +163,7 @@ public:
* @param valuesStride number of values to stride in the pointer between each copy.
*/
template
<
typename
T
>
void
getValuesCopy
(
const
unsigned
int
startIndex
,
T
*
valuesPointer
,
const
unsigned
int
numValues
=
1
,
const
unsigned
int
arrayStride
=
1
,
const
unsigned
int
valuesStride
=
1
)
const
;
void
getValuesCopy
(
const
unsigned
int
startIndex
,
T
*
const
valuesPointer
,
const
unsigned
int
numValues
=
1
,
const
unsigned
int
arrayStride
=
1
,
const
unsigned
int
valuesStride
=
1
)
const
;
/**
* Get a pointer to the values stored in this array (const version).
...
...
@@ -230,7 +230,7 @@ public:
*
* @param hdf5Controller the hdf5 controller to attach to this XdmfArray.
*/
void
setHDF5Controller
(
boost
::
shared_ptr
<
XdmfHDF5Controller
>
hdf5Controller
);
void
setHDF5Controller
(
const
boost
::
shared_ptr
<
XdmfHDF5Controller
>
hdf5Controller
);
/**
* Sets the values of this array to the values stored in the arrayPointer array. No copy is made. Modifications to the array are
...
...
@@ -266,7 +266,7 @@ public:
* @param array a smart pointer to a vector to store in this array.
*/
template
<
typename
T
>
void
setValues
(
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
);
void
setValues
(
const
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
);
/**
* Exchange the contents of the vector with the contents of this XdmfArray. No copy is made. The internal arrays are swapped.
...
...
@@ -283,7 +283,7 @@ public:
* @param array a smart pointer to a vector to exchange values with.
*/
template
<
typename
T
>
bool
swap
(
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
);
bool
swap
(
const
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
);
/**
* Exchange the contents of an XdmfArray with the contents of this XdmfArray. No copy is made. The internal arrays are swapped.
...
...
@@ -291,7 +291,7 @@ public:
* @param array a smart pointer to a vector to exchange values with.
* @return bool whether the swap was successful.
*/
void
swap
(
boost
::
shared_ptr
<
XdmfArray
>
array
);
void
swap
(
const
boost
::
shared_ptr
<
XdmfArray
>
array
);
protected:
...
...
XdmfArray.tpp
View file @
ef98c862
...
...
@@ -185,7 +185,7 @@ boost::shared_ptr<std::vector<T> > XdmfArray::getValues()
//}
template
<
typename
T
>
void
XdmfArray
::
getValuesCopy
(
const
unsigned
int
startIndex
,
T
*
valuesPointer
,
const
unsigned
int
numValues
,
const
unsigned
int
arrayStride
,
const
unsigned
int
valuesStride
)
const
void
XdmfArray
::
getValuesCopy
(
const
unsigned
int
startIndex
,
T
*
const
valuesPointer
,
const
unsigned
int
numValues
,
const
unsigned
int
arrayStride
,
const
unsigned
int
valuesStride
)
const
{
if
(
mHaveArray
)
{
...
...
@@ -287,7 +287,7 @@ void XdmfArray::setValues(std::vector<T> & array, const bool transferOwnership)
}
template
<
typename
T
>
void
XdmfArray
::
setValues
(
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
)
void
XdmfArray
::
setValues
(
const
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
)
{
if
(
mHaveArrayPointer
)
{
...
...
@@ -321,7 +321,7 @@ bool XdmfArray::swap(std::vector<T> & array)
}
template
<
typename
T
>
bool
XdmfArray
::
swap
(
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
)
bool
XdmfArray
::
swap
(
const
boost
::
shared_ptr
<
std
::
vector
<
T
>
>
array
)
{
return
this
->
swap
(
*
array
.
get
());
}
XdmfDataItem.cpp
View file @
ef98c862
...
...
@@ -40,12 +40,12 @@ void XdmfDataItem::populateItem(const std::map<std::string, std::string> & itemP
}
}
void
XdmfDataItem
::
setArray
(
boost
::
shared_ptr
<
XdmfArray
>
array
)
void
XdmfDataItem
::
setArray
(
const
boost
::
shared_ptr
<
XdmfArray
>
array
)
{
mArray
=
array
;
}
void
XdmfDataItem
::
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfDataItem
::
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
{
mArray
->
accept
(
visitor
);
}
XdmfDataItem.hpp
View file @
ef98c862
...
...
@@ -38,9 +38,9 @@ public:
*
* @param array a smart pointer to the XdmfArray.
*/
void
setArray
(
boost
::
shared_ptr
<
XdmfArray
>
array
);
void
setArray
(
const
boost
::
shared_ptr
<
XdmfArray
>
array
);
virtual
void
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
virtual
void
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
;
protected:
...
...
XdmfDomain.cpp
View file @
ef98c862
...
...
@@ -20,12 +20,12 @@ XdmfDomain::~XdmfDomain()
std
::
string
XdmfDomain
::
ItemTag
=
"Domain"
;
void
XdmfDomain
::
insert
(
boost
::
shared_ptr
<
XdmfGrid
>
grid
)
void
XdmfDomain
::
insert
(
const
boost
::
shared_ptr
<
XdmfGrid
>
grid
)
{
mGrids
.
push_back
(
grid
);
}
boost
::
shared_ptr
<
XdmfGrid
>
XdmfDomain
::
getGrid
(
unsigned
int
index
)
boost
::
shared_ptr
<
XdmfGrid
>
XdmfDomain
::
getGrid
(
const
unsigned
int
index
)
{
if
(
index
>=
mGrids
.
size
())
{
...
...
@@ -35,7 +35,7 @@ boost::shared_ptr<XdmfGrid> XdmfDomain::getGrid(unsigned int index)
return
mGrids
[
index
];
}
boost
::
shared_ptr
<
const
XdmfGrid
>
XdmfDomain
::
getGrid
(
unsigned
int
index
)
const
boost
::
shared_ptr
<
const
XdmfGrid
>
XdmfDomain
::
getGrid
(
const
unsigned
int
index
)
const
{
if
(
index
>=
mGrids
.
size
())
{
...
...
@@ -78,7 +78,7 @@ void XdmfDomain::removeGrid(const unsigned int index)
mGrids
.
erase
(
mGrids
.
begin
()
+
index
);
}
void
XdmfDomain
::
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfDomain
::
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
{
for
(
std
::
vector
<
boost
::
shared_ptr
<
XdmfGrid
>
>::
const_iterator
iter
=
mGrids
.
begin
();
iter
!=
mGrids
.
end
();
++
iter
)
{
...
...
XdmfDomain.hpp
View file @
ef98c862
...
...
@@ -27,7 +27,7 @@ public:
* @param index an unsigned int of the grid to retrieve.
* @return smart pointer to the grid at the specified index attached to this domain.
*/
boost
::
shared_ptr
<
XdmfGrid
>
getGrid
(
unsigned
int
index
);
boost
::
shared_ptr
<
XdmfGrid
>
getGrid
(
const
unsigned
int
index
);
/**
* Get a XdmfGrid attached to this domain (const version).
...
...
@@ -35,7 +35,7 @@ public:
* @param index of the grid to retrieve.
* @return pointer to the grid attached to this domain.
*/
boost
::
shared_ptr
<
const
XdmfGrid
>
getGrid
(
unsigned
int
index
)
const
;
boost
::
shared_ptr
<
const
XdmfGrid
>
getGrid
(
const
unsigned
int
index
)
const
;
std
::
map
<
std
::
string
,
std
::
string
>
getItemProperties
()
const
;
...
...
@@ -53,7 +53,7 @@ public:
*
* @param grid a shared pointer to an XdmfGrid to insert into the domain.
*/
void
insert
(
boost
::
shared_ptr
<
XdmfGrid
>
grid
);
void
insert
(
const
boost
::
shared_ptr
<
XdmfGrid
>
grid
);
/**
* Remove an XdmfGrid from the domain.
...
...
@@ -62,7 +62,7 @@ public:
*/
void
removeGrid
(
const
unsigned
int
index
);
virtual
void
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
virtual
void
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
;
protected:
...
...
XdmfGrid.cpp
View file @
ef98c862
...
...
@@ -118,12 +118,12 @@ boost::shared_ptr<const XdmfTopology> XdmfGrid::getTopology() const
return
boost
::
const_pointer_cast
<
XdmfTopology
>
(
static_cast
<
const
XdmfGrid
&>
(
*
this
).
getTopology
());
}
void
XdmfGrid
::
insert
(
boost
::
shared_ptr
<
XdmfAttribute
>
attribute
)
void
XdmfGrid
::
insert
(
const
boost
::
shared_ptr
<
XdmfAttribute
>
attribute
)
{
mAttributes
.
push_back
(
attribute
);
}
void
XdmfGrid
::
insert
(
boost
::
shared_ptr
<
XdmfSet
>
set
)
void
XdmfGrid
::
insert
(
const
boost
::
shared_ptr
<
XdmfSet
>
set
)
{
mSets
.
push_back
(
set
);
}
...
...
@@ -182,7 +182,7 @@ void XdmfGrid::removeSet(const unsigned int index)
mSets
.
erase
(
mSets
.
begin
()
+
index
);
}
void
XdmfGrid
::
setGeometry
(
boost
::
shared_ptr
<
XdmfGeometry
>
geometry
)
void
XdmfGrid
::
setGeometry
(
const
boost
::
shared_ptr
<
XdmfGeometry
>
geometry
)
{
mGeometry
=
geometry
;
}
...
...
@@ -192,12 +192,12 @@ void XdmfGrid::setName(const std::string & name)
mName
=
name
;
}
void
XdmfGrid
::
setTopology
(
boost
::
shared_ptr
<
XdmfTopology
>
topology
)
void
XdmfGrid
::
setTopology
(
const
boost
::
shared_ptr
<
XdmfTopology
>
topology
)
{
mTopology
=
topology
;
}
void
XdmfGrid
::
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfGrid
::
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
{
mGeometry
->
accept
(
visitor
);
mTopology
->
accept
(
visitor
);
...
...
XdmfGrid.hpp
View file @
ef98c862
...
...
@@ -132,14 +132,14 @@ public:
*
* @param attribute an XdmfAttribute to attach to this grid.
*/
void
insert
(
boost
::
shared_ptr
<
XdmfAttribute
>
attribute
);
void
insert
(
const
boost
::
shared_ptr
<
XdmfAttribute
>
attribute
);
/**
* Insert an XdmfSet into the grid.
*
* @param set an XdmfSet to attach to this grid.
*/
void
insert
(
boost
::
shared_ptr
<
XdmfSet
>
set
);
void
insert
(
const
boost
::
shared_ptr
<
XdmfSet
>
set
);
/**
* Remove an XdmfAttribute from the grid.
...
...
@@ -160,14 +160,14 @@ public:
*
* @param geometry an XdmfGeometry to attach to this grid.
*/
void
setGeometry
(
boost
::
shared_ptr
<
XdmfGeometry
>
geometry
);
void
setGeometry
(
const
boost
::
shared_ptr
<
XdmfGeometry
>
geometry
);
/**
* Set the XdmfTopology associated with this grid.
*
* @param topology an XdmfTopology to attach to this grid.
*/
void
setTopology
(
boost
::
shared_ptr
<
XdmfTopology
>
topology
);
void
setTopology
(
const
boost
::
shared_ptr
<
XdmfTopology
>
topology
);
/**
* Set the name of the grid.
...
...
@@ -176,7 +176,7 @@ public:
*/
void
setName
(
const
std
::
string
&
name
);
virtual
void
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
virtual
void
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
;
protected:
...
...
XdmfGridCollection.cpp
View file @
ef98c862
...
...
@@ -22,7 +22,7 @@ XdmfGridCollection::~XdmfGridCollection()
std
::
string
XdmfGridCollection
::
ItemTag
=
"Grid"
;
boost
::
shared_ptr
<
XdmfGrid
>
XdmfGridCollection
::
getGrid
(
unsigned
int
index
)
boost
::
shared_ptr
<
XdmfGrid
>
XdmfGridCollection
::
getGrid
(
const
unsigned
int
index
)
{
if
(
index
>=
mGrids
.
size
())
{
...
...
@@ -31,7 +31,7 @@ boost::shared_ptr<XdmfGrid> XdmfGridCollection::getGrid(unsigned int index)
return
mGrids
[
index
];
}
boost
::
shared_ptr
<
const
XdmfGrid
>
XdmfGridCollection
::
getGrid
(
unsigned
int
index
)
const
boost
::
shared_ptr
<
const
XdmfGrid
>
XdmfGridCollection
::
getGrid
(
const
unsigned
int
index
)
const
{
if
(
index
>=
mGrids
.
size
())
{
...
...
@@ -59,7 +59,7 @@ unsigned int XdmfGridCollection::getNumberOfGrids() const
return
mGrids
.
size
();
}
void
XdmfGridCollection
::
insert
(
boost
::
shared_ptr
<
XdmfGrid
>
grid
)
void
XdmfGridCollection
::
insert
(
const
boost
::
shared_ptr
<
XdmfGrid
>
grid
)
{
mGrids
.
push_back
(
grid
);
}
...
...
@@ -95,7 +95,7 @@ void XdmfGridCollection::setGridCollectionType(const boost::shared_ptr<const Xdm
mCollectionType
=
collectionType
;
}
void
XdmfGridCollection
::
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfGridCollection
::
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
{
for
(
std
::
vector
<
boost
::
shared_ptr
<
XdmfGrid
>
>::
const_iterator
iter
=
mGrids
.
begin
();
iter
!=
mGrids
.
end
();
++
iter
)
{
...
...
XdmfGridCollection.hpp
View file @
ef98c862
...
...
@@ -29,7 +29,7 @@ public:
* @param index of grid to retrieve.
* @return the requested XdmfGrid.
*/
boost
::
shared_ptr
<
XdmfGrid
>
getGrid
(
unsigned
int
index
);
boost
::
shared_ptr
<
XdmfGrid
>
getGrid
(
const
unsigned
int
index
);
/**
* Get a grid from this collection (const version).
...
...
@@ -37,7 +37,7 @@ public:
* @param index of the grid to retrieve.
* @return the requested XdmfGrid.
*/
boost
::
shared_ptr
<
const
XdmfGrid
>
getGrid
(
unsigned
int
index
)
const
;
boost
::
shared_ptr
<
const
XdmfGrid
>
getGrid
(
const
unsigned
int
index
)
const
;
/**
* Get the XdmfGridCollectionType associated with this grid collection.
...
...
@@ -60,7 +60,7 @@ public:
*
* @param grid an XdmfGrid to insert into this collection.
*/
void
insert
(
boost
::
shared_ptr
<
XdmfGrid
>
grid
);
void
insert
(
const
boost
::
shared_ptr
<
XdmfGrid
>
grid
);
/**
* Remove a grid from this collection.
...
...
@@ -76,7 +76,7 @@ public:
*/
void
setGridCollectionType
(
const
boost
::
shared_ptr
<
const
XdmfGridCollectionType
>
collectionType
);
virtual
void
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
virtual
void
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
;
protected:
...
...
XdmfHDF5Controller.cpp
View file @
ef98c862
...
...
@@ -6,7 +6,7 @@
#include
"XdmfArray.hpp"
#include
"XdmfHDF5Controller.hpp"
XdmfHDF5Controller
::
XdmfHDF5Controller
(
const
std
::
string
&
hdf5DataSetPath
,
const
int
precision
,
const
int
size
,
const
std
::
string
&
type
)
:
XdmfHDF5Controller
::
XdmfHDF5Controller
(
const
std
::
string
&
hdf5DataSetPath
,
const
unsigned
int
precision
,
const
unsigned
int
size
,
const
std
::
string
&
type
)
:
mPrecision
(
precision
),
mSize
(
size
),
mType
(
type
)
...
...
@@ -41,12 +41,12 @@ std::string XdmfHDF5Controller::getDataSetPath() const
return
toReturn
.
str
();
}
int
XdmfHDF5Controller
::
getPrecision
()
const
unsigned
int
XdmfHDF5Controller
::
getPrecision
()
const
{
return
mPrecision
;
}
int
XdmfHDF5Controller
::
getSize
()
const
unsigned
int
XdmfHDF5Controller
::
getSize
()
const
{
return
mSize
;
}
...
...
XdmfHDF5Controller.hpp
View file @
ef98c862
...
...
@@ -23,7 +23,7 @@ public:
/**
* Create a new controller for an hdf5 data set on disk.
*/
static
boost
::
shared_ptr
<
XdmfHDF5Controller
>
New
(
const
std
::
string
&
hdf5DataSetPath
,
const
int
precision
,
const
int
size
,
const
std
::
string
&
type
)
static
boost
::
shared_ptr
<
XdmfHDF5Controller
>
New
(
const
std
::
string
&
hdf5DataSetPath
,
const
unsigned
int
precision
,
const
unsigned
int
size
,
const
std
::
string
&
type
)
{
boost
::
shared_ptr
<
XdmfHDF5Controller
>
p
(
new
XdmfHDF5Controller
(
hdf5DataSetPath
,
precision
,
size
,
type
));
return
p
;
...
...
@@ -41,14 +41,14 @@ public:
*
* @return a int containing the precision of the hdf5 data set.
*/
int
getPrecision
()
const
;
unsigned
int
getPrecision
()
const
;
/**
* Get the size of the hdf5 data set owned by this controller.
*
* @return a int containing the size of the hdf5 data set.
*/
int
getSize
()
const
;
unsigned
int
getSize
()
const
;
/**
* Get the data type of the hdf5 data set owned by this controller.
...
...
@@ -66,7 +66,7 @@ public:
protected:
XdmfHDF5Controller
(
const
std
::
string
&
hdf5DataSetPath
,
const
int
precision
,
const
int
size
,
const
std
::
string
&
type
);
XdmfHDF5Controller
(
const
std
::
string
&
hdf5DataSetPath
,
const
unsigned
int
precision
,
const
unsigned
int
size
,
const
std
::
string
&
type
);
virtual
~
XdmfHDF5Controller
();
private:
...
...
@@ -76,8 +76,8 @@ private:
std
::
string
mDataSetName
;
std
::
string
mHDF5FilePath
;
int
mPrecision
;
int
mSize
;
unsigned
int
mPrecision
;
unsigned
int
mSize
;
std
::
string
mType
;
};
...
...
XdmfHDF5Writer.cpp
View file @
ef98c862
...
...
@@ -111,7 +111,7 @@ std::string XdmfHDF5Writer::getLastWrittenDataSet() const
return
mImpl
->
mLastWrittenDataSet
;
}
void
XdmfHDF5Writer
::
visit
(
XdmfArray
&
array
,
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfHDF5Writer
::
visit
(
XdmfArray
&
array
,
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
{
hid_t
datatype
=
-
1
;
mImpl
->
mLastWrittenDataSet
=
""
;
...
...
XdmfHDF5Writer.hpp
View file @
ef98c862
...
...
@@ -45,7 +45,7 @@ public:
* @param array an XdmfArray to write to HDF5.
* @param visitor a smart pointer to this visitor --- aids in grid traversal.
*/
void
visit
(
XdmfArray
&
array
,
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
void
visit
(
XdmfArray
&
array
,
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
protected:
...
...
XdmfItem.cpp
View file @
ef98c862
...
...
@@ -8,7 +8,7 @@ XdmfItem::~XdmfItem()
{
}
void
XdmfItem
::
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfItem
::
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
{
return
;
}
XdmfItem.hpp
View file @
ef98c862
...
...
@@ -49,7 +49,7 @@ public:
*
* @param a visitor to pass to this XdmfItem's children.
*/
virtual
void
traverse
(
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
virtual
void
traverse
(
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
const
;
protected:
...
...
XdmfVisitor.cpp
View file @
ef98c862
...
...
@@ -12,7 +12,7 @@ XdmfVisitor::~XdmfVisitor()
{
}
void
XdmfVisitor
::
visit
(
XdmfItem
&
item
,
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfVisitor
::
visit
(
XdmfItem
&
item
,
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
{
std
::
cout
<<
"Writing in base"
<<
std
::
endl
;
item
.
traverse
(
visitor
);
...
...
XdmfVisitor.hpp
View file @
ef98c862
...
...
@@ -20,7 +20,7 @@ class XdmfVisitor : public XdmfObject,
public:
virtual
void
visit
(
XdmfItem
&
item
,
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
virtual
void
visit
(
XdmfItem
&
item
,
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
);
protected:
...
...
XdmfWriter.cpp
View file @
ef98c862
...
...
@@ -15,7 +15,7 @@ class XdmfWriter::XdmfWriterImpl {
public:
XdmfWriterImpl
(
const
std
::
string
&
xmlFilePath
,
boost
::
shared_ptr
<
XdmfHDF5Writer
>
hdf5Writer
)
:
XdmfWriterImpl
(
const
std
::
string
&
xmlFilePath
,
const
boost
::
shared_ptr
<
XdmfHDF5Writer
>
hdf5Writer
)
:
mHDF5Writer
(
hdf5Writer
),
mLightDataLimit
(
100
),
mXMLFilePath
(
xmlFilePath
),
...
...
@@ -81,12 +81,12 @@ void XdmfWriter::openFile()
xmlDocSetRootElement
(
mImpl
->
mXMLDocument
,
mImpl
->
mXMLCurrentNode
);
}
void
XdmfWriter
::
setLightDataLimit
(
unsigned
int
numValues
)
void
XdmfWriter
::
setLightDataLimit
(
const
unsigned
int
numValues
)
{
mImpl
->
mLightDataLimit
=
numValues
;
}
void
XdmfWriter
::
visit
(
XdmfArray
&
array
,
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfWriter
::
visit
(
XdmfArray
&
array
,
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
{
std
::
stringstream
xmlTextValues
;
if
(
array
.
getHDF5Controller
()
||
array
.
getSize
()
>
mImpl
->
mLightDataLimit
)
...
...
@@ -103,7 +103,7 @@ void XdmfWriter::visit(XdmfArray & array, boost::shared_ptr<XdmfBaseVisitor> vis
xmlAddChild
(
mImpl
->
mXMLCurrentNode
->
children
,
xmlNewText
((
xmlChar
*
)
xmlTextValues
.
str
().
c_str
()));
}
void
XdmfWriter
::
visit
(
XdmfItem
&
item
,
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
void
XdmfWriter
::
visit
(
XdmfItem
&
item
,
const
boost
::
shared_ptr
<
XdmfBaseVisitor
>
visitor
)
{
if
(
mImpl
->
mTraverseLevel
==
0
)
{
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment