$extrastylesheet
#include <utility.h>
Public Member Functions | |
| ReverseBytes (const bool dr) | |
| template<typename T > | |
| T | operator() (T &data) const |
Private Member Functions | |
| bool | reverse () const |
Private Attributes | |
| const bool | _do_reverse |
This Functor simply takes an object and reverses its byte representation. This is useful for changing endian-ness for file IO. This class has been tested on x86 architectures with 4-byte words.
| libMesh::Utility::ReverseBytes::ReverseBytes | ( | const bool | dr | ) | [inline, explicit] |
Constructor. Takes a bool, determines if we will actually do byte reversing.
Definition at line 299 of file utility.h.
: _do_reverse (rb) {}
| T libMesh::Utility::ReverseBytes::operator() | ( | T & | data | ) | const [inline] |
Functor. Takes the data to reverse and performs the byte-ordering reversal.
Definition at line 306 of file utility.h.
References data, reverse(), and libMesh::swap().
| bool libMesh::Utility::ReverseBytes::reverse | ( | ) | const [inline, private] |
Returns the value of the reverse flag.
Definition at line 286 of file utility.h.
References _do_reverse.
Referenced by operator()().
{ return _do_reverse; }
const bool libMesh::Utility::ReverseBytes::_do_reverse [private] |