Block-Structured AMR Software Framework
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. 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)
 

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 a specific IntDescriptor.

Member Function Documentation

◆ numBytes()

int amrex::IntDescriptor::numBytes ( ) const

Returns the number of bytes.

◆ 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 ordering.

Friends And Related Function Documentation

◆ operator>>

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

Read in an IntDescriptor from an istream.

Member Data Documentation

◆ numbytes

Long amrex::IntDescriptor::numbytes
private

◆ ord

Ordering amrex::IntDescriptor::ord
private

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