Main Page | Class Hierarchy | Compound List | File List | Compound Members

BxDimension Class Reference

Class managing the indexing information for one dimension of an array. More...

#include <BxDimension.h>

Inheritance diagram for BxDimension:

BxObject List of all members.

Public Member Functions

 BxDimension ()
 BxDimension (int from, int to, const char *name)
 BxDimension (const BxDimension &copy)
char * toString (bool close)
void setName (char *name)
void copyName (const char *name)

Detailed Description

A dimension is identified by a dimension name, and it is described by indexFrom and indexTo values. These values are defined in the Bin XML schema element <dim> within the type defintion section of a BinX document.
Example Specification
The following is an example of dimension specification in a BinX document.
       <dim indexFrom="0" indexTo="15" name="column1"/>
   

This class is used by the class BxArray to manage array dimensions.
Since: BinX version 1.0.


Constructor & Destructor Documentation

BxDimension::BxDimension  ) 
 

Default constructor.

Constructs an instance of the class BxDimension. Default attribute values are assigned as follows:

       indexFrom_ = 0;
       indexTo_ = -1;
       name_ = NULL;
   

BxDimension::BxDimension int  from,
int  to,
const char *  name
 

Construct a dimension object with specified name and indexing information.

Parameters:
from The indexFrom value for the dimension object.
to The indexTo value for the dimension object.
name A pointer to a name for the dimension object.

BxDimension::BxDimension const BxDimension copy  ) 
 

Construct a dimension object having attribute values identical to a specified dimension object.

Attributes of the new dimension object are initialized by copying attribute values from the specified input dimension object.
Upon completion of the construction operation, the two dimension objects are independent. They be individually destructed.

Parameters:
copy The BxDimension instance whose attribute values are to be copied.


Member Function Documentation

void BxDimension::copyName const char *  name  ) 
 

Copies a specified constant string value.

Memory is allocated to hold a copy of the input string. The input name is copied into the new string. The new string is assigned as the name of this dimension object. The caller is responsible for releasing the input string when it is no longer needed.

Parameters:
name A pointer to a name to copy as the name for this dimension object.

int BxDimension::getCount  )  [inline]
 

Returns the total number of elements in this dimension.

int BxDimension::getIndexFrom  )  [inline]
 

Returns the zero-based index of the first element of this dimension, normally zero.

int BxDimension::getIndexTo  )  [inline]
 

Returns the zero-based index of the last element of this dimension.

char* BxDimension::getName  )  [inline]
 

Returns the name associated with this dimension.

void BxDimension::setIndexFrom int  from  )  [inline]
 

Sets the index value associated with the first element of this dimension to a specified value.

void BxDimension::setIndexTo int  to  )  [inline]
 

Sets the index value associated with the last element of this dimension to a specified value.

void BxDimension::setName char *  name  ) 
 

Sets the nameassociated with this dimension to a specified value.

Upon completion of this method, the string containing the dimension name is referenced by this object. The caller must not delete the string after invoking this method. This object will release the string when this object is destructed.

Parameters:
name A pointer to a name for this dimension object.

char * BxDimension::toString bool  close  ) 
 

Build a BinX XML element containing the dimension definition for this dimension object.

Memory is allocated for a string to hold the BinX XML dimension specification. The caller is responsible for releasing the string when it is no longer needed.
A boolean input flag is used to indicate whether to include the optional "/" at the end of the returned BinX XML string. If the input flag value is true, then the slash character is included in the result. If the input flag cvalue is fale, then the slash character is omitted from the result string.
Example Results:

       <dim name="day7-data" indexTo="2999"/>
   
The example returned string describes an array dimension named "day7-data". The dimension contains 3000 data values, indexed from [0] to [2999]. The input parameter requested that the closing "/" character be included in the result string.
Parameters:
close A boolean value indicating whether to include a closing "/" in the result.
Returns:
A string containing a BinX XML string for this definition object.


The documentation for this class was generated from the following files:
Generated on Fri May 6 13:36:19 2005 for edikt::BinX by doxygen 1.3.3