A Descriptor of the Long Integer type. More...
#include <AMReX_FabConv.H>
Public Types | |
enum | Ordering { NormalOrder = 1 , ReverseOrder = 2 } |
An enumeration describing the two orderings that we currently support: NormalOrder and ReverseOrder. Other orderings may be added as AMReX is ported to run on machines with non-standard orderings. More... | |
Public Member Functions | |
IntDescriptor ()=default | |
The default constructor. Does not build a proper IntDescriptor. This should only be used when you need to build a generic IntDescriptor in order to be able to read in a specific one from an istream. More... | |
IntDescriptor (Long nb, Ordering ordering=NormalOrder) | |
Construct a specific IntDescriptor. More... | |
Ordering | order () const |
Returns the ordering. More... | |
int | numBytes () const |
Returns the number of bytes. More... | |
bool | operator== (const IntDescriptor &id) const |
The equality operator. More... | |
bool | operator!= (const IntDescriptor &id) const |
The inequality operator. More... | |
Private Attributes | |
Long | numbytes |
Ordering | ord |
Friends | |
std::istream & | operator>> (std::istream &is, IntDescriptor &id) |
A Descriptor of the Long Integer type.
This class is meant to hold all information needed to completely describe the "int" or "Long" type on a machine. To describe an integer both the number of bytes and their ordering, relative to canonical ordering 1 .. sizeof(Long), needs to be specified. This allows us to write out integers in the native format on a machine, and then by also saving the IntDescriptor, we can read them back in on another machine and have enough information to construct the exact same values.
An enumeration describing the two orderings that we currently support: NormalOrder and ReverseOrder. Other orderings may be added as AMReX is ported to run on machines with non-standard orderings.
Enumerator | |
---|---|
NormalOrder | |
ReverseOrder |
|
default |
The default constructor. Does not build a proper IntDescriptor. This should only be used when you need to build a generic IntDescriptor in order to be able to read in a specific one from an istream.
amrex::IntDescriptor::IntDescriptor | ( | Long | nb, |
Ordering | ordering = NormalOrder |
||
) |
Construct a specific IntDescriptor.
int amrex::IntDescriptor::numBytes | ( | ) | const |
Returns the number of bytes.
bool amrex::IntDescriptor::operator!= | ( | const IntDescriptor & | id | ) | const |
The inequality operator.
bool amrex::IntDescriptor::operator== | ( | const IntDescriptor & | id | ) | const |
The equality operator.
IntDescriptor::Ordering amrex::IntDescriptor::order | ( | ) | const |
Returns the ordering.
|
friend |
Read in an IntDescriptor from an istream.
|
private |
|
private |