![]() |
Block-Structured AMR Software Framework
|
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. | |
| IntDescriptor (Long nb, Ordering ordering=NormalOrder) | |
Construct an IntDescriptor with nb bytes and byte order ordering. | |
| Ordering | order () const |
| Returns the stored byte ordering policy. | |
| int | numBytes () const |
| Returns the number of bytes per integer. | |
| bool | operator== (const IntDescriptor &id) const |
| The equality operator. | |
| bool | operator!= (const IntDescriptor &id) const |
| The inequality operator. | |
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 an IntDescriptor with nb bytes and byte order ordering.
| nb | Number of bytes in the represented integer type. |
| ordering | IntDescriptor::NormalOrder for the canonical byte order 1 .. nb, or IntDescriptor::ReverseOrder for its reverse. |
| int amrex::IntDescriptor::numBytes | ( | ) | const |
Returns the number of bytes per integer.
| 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 stored byte ordering policy.
|
friend |
Read in an IntDescriptor from an istream.