bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
AsciiArray Class Reference
Inheritance diagram for AsciiArray:
Inheritance graph
Collaboration diagram for AsciiArray:
Collaboration graph

Public Member Functions

 AsciiArray (Array *bt)
 
 AsciiArray (const string &n, BaseType *v)
 
string get_full_name ()
 
int get_index (vector< int > indices) throw (InternalErr)
 
int get_nth_dim_size (size_t n) throw (InternalErr)
 
vector< intget_shape_vector (size_t n) throw (InternalErr)
 
bool increment_state (vector< int > *state, const vector< int > &shape)
 
virtual void print_ascii (ostream &strm, bool print_name=true) throw (InternalErr)
 
int print_row (ostream &strm, int index, int number)
 
virtual BaseType * ptr_duplicate ()
 

Protected Attributes

BaseType * _redirect
 

Detailed Description

Definition at line 44 of file AsciiArray.h.

Constructor & Destructor Documentation

◆ AsciiArray() [1/2]

AsciiArray::AsciiArray ( const string & n,
BaseType * v )

Definition at line 61 of file AsciiArray.cc.

◆ AsciiArray() [2/2]

AsciiArray::AsciiArray ( Array * bt)

Definition at line 65 of file AsciiArray.cc.

◆ ~AsciiArray()

AsciiArray::~AsciiArray ( )
virtual

Definition at line 90 of file AsciiArray.cc.

Member Function Documentation

◆ get_full_name()

string AsciiOutput::get_full_name ( )
inherited

Get the fully qualified name of this object. Names of nested constructor types are separated by dots (.).

Returns
The fully qualified name of this object.

◆ get_index()

int AsciiArray::get_index ( vector< int > indices)
throw (InternalErr )

Definition at line 183 of file AsciiArray.cc.

◆ get_nth_dim_size()

int AsciiArray::get_nth_dim_size ( size_t n)
throw (InternalErr )

Get the size of dimension #n#.

Parameters
nReturn the size of the n^{th} dimension.
Returns
The size of the n^{th} dimension.
Exceptions
InternalErr.

Get the size of the Nth dimension. The first dimension is N == 0.

Parameters
nThe index. Uses sero-based indexing.
Returns
the size of the dimension.

Definition at line 239 of file AsciiArray.cc.

◆ get_shape_vector()

vector< int > AsciiArray::get_shape_vector ( size_t n)
throw (InternalErr )

Get the sizes of the first N dimensions of this array. This ‘shape vector’ may be used in all sorts of output formatters.

Returns
A vector describing the shape of the array. Each value contains the highest index value. To get the size, add one.

Definition at line 216 of file AsciiArray.cc.

◆ increment_state()

bool AsciiOutput::increment_state ( vector< int > * state,
const vector< int > & shape )
inherited

Increment #state# to the next value given #shape#. This method uses simple modulo arithmetic to provide a way to iterate over all combinations of dimensions of an Array or Grid. The vector #shape# holds the maximum sizes of each of N dimensions. The vector #state# holds the current index values of those N dimensions. Calling this method increments #state# to the next dimension, varying the rightmost fastest.

To print DODS Array and Grid objects according to the DAP 2.0 specification, #state# and #shape# should be vectors of length N-1 for an object of dimension N.

Returns
True if there are more states, false if not.

◆ print_ascii()

void AsciiArray::print_ascii ( ostream & strm,
bool print_name = true )
throw (InternalErr )
virtual

Print an ASCII representation for an instance of BaseType's children. This version prints the suggested output only for simple types. Complex types should overload this with their own definition.

The caller of this method is responsible for adding a trialing comma where appropriate.

Parameters
strmWrite to this stream.
print_nameIf True, write the name of the variable, a comma and then the value. If False, simply write the value.

Reimplemented from AsciiOutput.

Definition at line 94 of file AsciiArray.cc.

◆ print_row()

int AsciiArray::print_row ( ostream & strm,
int index,
int number )

Print a single row of values for a N-dimensional array. Since we store N-dim arrays in vectors, #index# gives the starting point in that vector for this row and #number# is the number of values to print. The counter #index# is returned.

Parameters
osWrite to stream os.
indexPrint values starting from this point.
numberPrint this many values.
Returns
One past the last value printed (i.e., the index of the next row's first value).
See also
print_array

Definition at line 154 of file AsciiArray.cc.

◆ ptr_duplicate()

BaseType * AsciiArray::ptr_duplicate ( )
virtual

Definition at line 56 of file AsciiArray.cc.

Member Data Documentation

◆ _redirect

BaseType* AsciiOutput::_redirect
protectedinherited

Definition at line 51 of file AsciiOutput.h.


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