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
Development
openfoam
Commits
4e178446
Commit
4e178446
authored
Sep 15, 2008
by
mattijs
Browse files
access to underlying list
parent
a105eaf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/containers/Lists/PackedList/PackedList.H
View file @
4e178446
...
...
@@ -160,13 +160,15 @@ public:
//- Number of packed elements
inline
label
size
()
const
;
//- Get value at index I
inline
unsigned
int
get
(
const
label
i
)
const
;
//- Set value at index I. Return true if value changed.
inline
bool
set
(
const
label
i
,
const
unsigned
int
val
);
//- Underlying storage
inline
List
<
unsigned
int
>&
storage
();
// Member operators
...
...
@@ -179,7 +181,8 @@ public:
//- Assignment operator. Takes linear time.
void
operator
=
(
const
PackedList
<
nBits
>&
);
//- Assignment of all entries to the given value
//- Assignment of all entries to the given value. Does set on all
// elements.
inline
void
operator
=
(
const
unsigned
int
val
);
//- Return as labelList
...
...
src/OpenFOAM/containers/Lists/PackedList/PackedListI.H
View file @
4e178446
...
...
@@ -83,7 +83,7 @@ inline void PackedList<nBits>::checkValue(const unsigned int val) const
{
if
(
val
>=
(
1u
<<
nBits
))
{
FatalErrorIn
(
"PackedList<T>::
set
(const unsigned int)"
)
FatalErrorIn
(
"PackedList<T>::
checkValue
(const unsigned int)"
)
<<
"value "
<<
label
(
val
)
<<
" out of range 0 ... "
<<
label
((
1u
<<
nBits
)
-
1
)
<<
" representable by "
<<
nBits
<<
" bits"
...
...
@@ -183,6 +183,13 @@ inline bool PackedList<nBits>::set(const label i, const unsigned int val)
}
template
<
int
nBits
>
inline
List
<
unsigned
int
>&
PackedList
<
nBits
>::
storage
()
{
return
static_cast
<
List
<
unsigned
int
>&>
(
*
this
);
}
template
<
int
nBits
>
inline
::
Foam
::
reference
PackedList
<
nBits
>::
operator
[](
const
label
i
)
{
...
...
@@ -213,9 +220,14 @@ inline void PackedList<nBits>::operator=(const unsigned int val)
# ifdef DEBUGList
checkValue
(
val
);
# endif
List
<
unsigned
int
>::
operator
=
(
val
);
for
(
label
i
=
0
;
i
<
size
;
i
++
)
{
set
(
i
,
val
);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
...
...
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