Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

Floats Class Reference
[Miscellaneous Library Utilities]

#include <Floats.hh>

List of all members.


Detailed Description

Utility class to implement an arbitrary size array of floats.

The Floats class implements an arbitrary size array of floating point numbers. It is not very efficient as it internally allocates memory for array storage, but it is convenient for passing arrays of floats to and from functions.


Public Member Functions

 Floats (int in_count, const char *n=NULL)
 Floats (float *in_array, int size, const char *n=NULL)
 Floats (const char *n=NULL)
 Floats (const Floats &in)
 ~Floats (void)
Floatsoperator= (const Floats &rhs)
float get (int index) const
void set (int index, float f)
int getCount (void) const
float * getArray (void) const
void redefine (float *in_array, int size)
void fill (float *in_array)


Constructor & Destructor Documentation

Floats::Floats int  in_count,
const char *  n = NULL
 

This constructor creates an array of size "in_count", with name "n"

Floats::Floats float *  in_array,
int  size,
const char *  n = NULL
 

This constructor creates an array of size "size", with name "n" whose contents are copied from "in_array".

Floats::Floats const char *  n = NULL  )  [inline]
 

This constructor creates an array of size 0, with name "n"

Floats::Floats const Floats in  ) 
 

This is the copy constructor

Floats::~Floats void   ) 
 

The destructor frees up all the internal memory allocated at creation or resizing


Member Function Documentation

void Floats::fill float *  in_array  )  [inline]
 

Debugging method to print out contents of array

float Floats::get int  index  )  const
 

This method returns the float at location "index" in the array

float* Floats::getArray void   )  const [inline]
 

This method returns a pointer to the internal array of floats. Use with caution, preferably for read-only purposes.

int Floats::getCount void   )  const [inline]
 

This method returns the number of elements in the array

Floats& Floats::operator= const Floats rhs  ) 
 

Assignment operator

void Floats::set int  index,
float  f
 

This method sets the float at location "index" to the indicated value.


RHexLib Reference Documentation