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
a8a3ea54
Commit
a8a3ea54
authored
Sep 03, 2008
by
mattijs
Browse files
binary output
parent
fe72c1c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/boundBox/boundBox.C
View file @
a8a3ea54
...
...
@@ -87,9 +87,47 @@ boundBox::boundBox(Istream& is)
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
Ostream
&
operator
<<
(
Ostream
&
os
,
const
boundBox
&
b
)
Ostream
&
operator
<<
(
Ostream
&
os
,
const
boundBox
&
b
b
)
{
return
os
<<
b
.
min
()
<<
token
::
SPACE
<<
b
.
max
();
if
(
os
.
format
()
==
IOstream
::
ASCII
)
{
os
<<
bb
.
min_
<<
token
::
SPACE
<<
bb
.
max_
;
}
else
{
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
bb
.
min_
),
sizeof
(
boundBox
)
);
}
// Check state of Ostream
os
.
check
(
"Ostream& operator<<(Ostream&, const boundBox&)"
);
return
os
;
}
Istream
&
operator
>>
(
Istream
&
is
,
boundBox
&
bb
)
{
if
(
is
.
format
()
==
IOstream
::
ASCII
)
{
return
is
>>
bb
.
min_
>>
bb
.
max_
;
}
else
{
is
.
read
(
reinterpret_cast
<
char
*>
(
&
bb
.
min_
),
sizeof
(
boundBox
)
);
}
// Check state of Istream
is
.
check
(
"Istream& operator>>(Istream&, boundBox&)"
);
return
is
;
}
...
...
src/OpenFOAM/meshes/boundBox/boundBox.H
View file @
a8a3ea54
...
...
@@ -153,12 +153,31 @@ public:
}
//
Ostream o
perator
//
Friend O
perator
s
friend
Ostream
&
operator
<<
(
Ostream
&
os
,
const
boundBox
&
b
);
friend
bool
operator
==
(
const
boundBox
&
a
,
const
boundBox
&
b
)
{
return
(
a
.
min_
==
b
.
min_
)
&&
(
a
.
max_
==
b
.
max_
);
}
friend
bool
operator
!=
(
const
boundBox
&
a
,
const
boundBox
&
b
)
{
return
!
(
a
==
b
);
}
// IOstream operator
friend
Istream
&
operator
>>
(
Istream
&
is
,
boundBox
&
);
friend
Ostream
&
operator
<<
(
Ostream
&
os
,
const
boundBox
&
);
};
//- Specify data associated with boundBox type is contiguous
template
<
>
inline
bool
contiguous
<
boundBox
>
()
{
return
contiguous
<
point
>
();}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// 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