Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::IntDescriptor Class Reference

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)
 

Detailed Description

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.

Member Enumeration Documentation

◆ Ordering

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 

Constructor & Destructor Documentation

◆ IntDescriptor() [1/2]

amrex::IntDescriptor::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() [2/2]

amrex::IntDescriptor::IntDescriptor ( Long  nb,
Ordering  ordering = NormalOrder 
)

Construct an IntDescriptor with nb bytes and byte order ordering.

Parameters
nbNumber of bytes in the represented integer type.
orderingIntDescriptor::NormalOrder for the canonical byte order 1 .. nb, or IntDescriptor::ReverseOrder for its reverse.

Member Function Documentation

◆ numBytes()

int amrex::IntDescriptor::numBytes ( ) const

Returns the number of bytes per integer.

◆ operator!=()

bool amrex::IntDescriptor::operator!= ( const IntDescriptor id) const

The inequality operator.

◆ operator==()

bool amrex::IntDescriptor::operator== ( const IntDescriptor id) const

The equality operator.

◆ order()

IntDescriptor::Ordering amrex::IntDescriptor::order ( ) const

Returns the stored byte ordering policy.

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream &  is,
IntDescriptor id 
)
friend

Read in an IntDescriptor from an istream.


The documentation for this class was generated from the following files: