EleFits  5.0.0
A modern C++ API on top of CFITSIO
Static Public Member Functions | Public Member Functions | Public Attributes | Related Functions | List of all members
Segment Struct Reference

#include <Segment.h>

Detailed Description

Bounds of a closed index interval.

The lower and upper bounds are named front and back to match Segment wording. This also avoids confusion when working with table segments, where the lower bound is upward the upper bound.

Static Public Member Functions

static Segment fromSize (long front, long size)
 Create a segment specified by a lower bound and size.
 
static Segment whole ()
 Create a maximal segment (from index 0 to max).
 

Public Member Functions

long size () const
 Get the number of elements.
 

Public Attributes

long front
 The lower bound.
 
long back
 The upper bound.
 

Related Functions

(Note that these are not member functions.)

bool operator== (const Segment &lhs, const Segment &rhs)
 Check whether two segments are equal.
 
bool operator!= (const Segment &lhs, const Segment &rhs)
 Check whether two segments are different.
 
Segmentoperator+= (Segment &lhs, long rhs)
 Add a scalar.
 
Segmentoperator-= (Segment &lhs, long rhs)
 Subtract a scalar.
 
Segmentoperator++ (Segment &lhs)
 Add 1.
 
Segmentoperator-- (Segment &lhs)
 Subtract 1.
 
Segment operator++ (Segment &lhs, int)
 Return the current segment and then add 1.
 
Segment operator-- (Segment &lhs, int)
 Return the current segment and then subtract 1.
 
Segment operator+ (const Segment &rhs)
 Identity.
 
Segment operator- (const Segment &rhs)
 Change the sign of each coordinate.
 
Segment operator+ (const Segment &lhs, long rhs)
 Add a segment and a scalar.
 
Segment operator- (const Segment &lhs, long rhs)
 Subtract a segment and a scalar.
 

The documentation for this struct was generated from the following file: