Skip to content
GitLab
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
814a4c67
Commit
814a4c67
authored
Aug 01, 2011
by
Kenneth Leiter
Browse files
Merge branch 'master' of
ssh://hsai-dev.arl.army.mil/data/Repository/Xdmf2
parents
6d64b4aa
4bb47fc4
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/XdmfArray.cpp
View file @
814a4c67
...
...
@@ -159,7 +159,7 @@ public:
};
class
XdmfArray
::
GetValuesPointer
:
public
boost
::
static_visitor
<
const
void
*
const
>
{
public
boost
::
static_visitor
<
const
void
*>
{
public:
GetValuesPointer
()
...
...
@@ -167,14 +167,14 @@ public:
}
template
<
typename
T
>
const
void
*
const
const
void
*
operator
()(
const
shared_ptr
<
std
::
vector
<
T
>
>
&
array
)
const
{
return
&
array
->
operator
[](
0
);
}
template
<
typename
T
>
const
void
*
const
const
void
*
operator
()(
const
boost
::
shared_array
<
const
T
>
&
array
)
const
{
return
array
.
get
();
...
...
@@ -199,7 +199,7 @@ public:
getValuesString
(
const
T
*
const
array
,
const
int
numValues
)
const
{
const
unsigned
int
lastIndex
=
numValues
-
1
;
const
int
lastIndex
=
numValues
-
1
;
if
(
lastIndex
<
0
)
{
return
""
;
...
...
core/XdmfArray.hpp
View file @
814a4c67
...
...
@@ -277,6 +277,8 @@ public:
void
initialize
(
const
shared_ptr
<
const
XdmfArrayType
>
arrayType
,
const
std
::
vector
<
unsigned
int
>
&
dimensions
);
using
XdmfItem
::
insert
;
/**
* Insert value into this array
*
...
...
@@ -340,7 +342,6 @@ public:
* Read data from disk into memory.
*/
void
read
();
/**
* Release all data currently held in memory.
*/
...
...
core/tests/Cxx/TestXdmfArray.cpp
View file @
814a4c67
...
...
@@ -26,8 +26,8 @@ int main(int, char **)
assert
(
array
->
getSize
()
==
4
);
assert
(
array
->
getArrayType
()
==
XdmfArrayType
::
Int32
());
assert
(
array
->
getValuesString
().
compare
(
"1 2 3 4"
)
==
0
);
const
int
*
const
arrayPointer
=
(
con
st
int
*
const
)
array
->
getValuesInternal
();
const
int
*
const
arrayPointer
=
static_ca
st
<
int
*
>
(
array
->
getValuesInternal
()
)
;
assert
(
arrayPointer
[
0
]
==
1
);
assert
(
arrayPointer
[
1
]
==
2
);
assert
(
arrayPointer
[
2
]
==
3
);
...
...
@@ -121,8 +121,8 @@ int main(int, char **)
assert
(
array5
->
getSize
()
==
2
);
assert
(
array5
->
getArrayType
()
==
XdmfArrayType
::
Int32
());
assert
(
array5
->
getValuesString
().
compare
(
"1 2"
)
==
0
);
const
int
*
const
array5Pointer
=
(
con
st
int
*
const
)
array5
->
getValuesInternal
();
const
int
*
const
array5Pointer
=
static_ca
st
<
int
*
>
(
array5
->
getValuesInternal
()
)
;
assert
(
array5Pointer
[
0
]
==
1
);
assert
(
array5Pointer
[
1
]
==
2
);
// Assert we can copy values out correctly
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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