USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::TableField Class Reference
[Low Level Cube I/O]

#include <TableField.h>

Collaboration diagram for Isis::TableField:

Collaboration graph
[legend]
List of all members.

Detailed Description

Author:
2004-09-01 Jeff Anderson

For internal use only.

History:
2005-03-18 Elizabeth Ribelin - Added documentation to the class
History:
2007-05-28 Steven Lambright - Added 4 byte floating point capabilities
Todo:
Finish class documentation

Definition at line 44 of file TableField.h.

Public Types

 Integer
 Double
 Text
 Real
enum  Type { Integer, Double, Text, Real }

Public Member Functions

 TableField (const std::string &name, Isis::TableField::Type type, int size=1)
 Constructs a TableField object.
 TableField (Isis::PvlGroup &field)
 Constructs a TableField object from a PvlGroup.
 ~TableField ()
 Destroys the TableField object.
std::string Name () const
 Returns the name of the TableField.
bool IsInteger () const
 Checks to see if field type is Integer.
bool IsDouble () const
 Checks to see if field type is Double.
bool IsText () const
 Checks to see if field type is Text.
bool IsReal () const
 Checks to see if field type is Text.
int Bytes () const
 Returns the number of bytes in the field.
int Size () const
 Returns the size of the field.
 operator double () const
 operator std::vector () const
 operator int () const
 operator std::vector () const
 operator std::string () const
 operator float () const
 operator std::vector () const
void operator= (const int value)
 Sets field value equal to input.
void operator= (const double value)
 Sets field value equal to input.
void operator= (const float value)
 Sets field value equal to input.
void operator= (const std::string &value)
 Sets field value equal to input.
void operator= (const std::vector< int > &values)
 Sets field value equal to input.
void operator= (const std::vector< double > &values)
 Sets field value equal to the input.
void operator= (const std::vector< float > &value)
 Sets field value equal to the input.
void operator= (const char *buf)
void operator= (const void *buf)
Isis::PvlGroup PvlGroup ()
 Creates and returns a PvlGroup named "Field" containing the following keywords and their respective values: "Name", "Type", and "Size".

Private Attributes

std::string p_name
 Name of field.
Type p_type
 Type of field.
int p_size
 Size of field.
int p_bytes
 Number of bytes in field.
std::vector< int > p_ivalues
 Vector of Integer values.
std::vector< double > p_dvalues
 Vector of Double values.
std::vector< float > p_rvalues
 Vector of Real values.
std::string p_svalue
 string value of field


Constructor & Destructor Documentation

Isis::TableField::TableField ( const std::string &  name,
Isis::TableField::Type  type,
int  size = 1 
)

Constructs a TableField object.

Parameters:
name The name of the field
type The type of the field
size The size of the field. Defaults to 0.

Definition at line 38 of file TableField.cpp.

References p_bytes, p_dvalues, p_ivalues, p_name, p_rvalues, p_size, p_svalue, and p_type.

Isis::TableField::TableField ( Isis::PvlGroup field  ) 

Constructs a TableField object from a PvlGroup.

Parameters:
field PvlGroup containing Name, Size, and Type for new TableField object
Exceptions:
Isis::iException::Programmer - Invalid field type

Definition at line 69 of file TableField.cpp.

References _FILEINFO_, field, Isis::iException::Message(), p_bytes, p_dvalues, p_ivalues, p_name, p_rvalues, p_size, p_svalue, and p_type.

Isis::TableField::~TableField (  ) 

Destroys the TableField object.

Definition at line 99 of file TableField.cpp.


Member Function Documentation

int Isis::TableField::Bytes (  )  const [inline]

Returns the number of bytes in the field.

Returns:
The number of bytes in the TableField

Definition at line 94 of file TableField.h.

References p_bytes.

Referenced by operator=().

bool Isis::TableField::IsDouble (  )  const [inline]

Checks to see if field type is Double.

Returns:
Returns true if field type is Double, and false if it is not

Definition at line 73 of file TableField.h.

References p_type.

Referenced by Isis::Blobber::load().

bool Isis::TableField::IsInteger (  )  const [inline]

Checks to see if field type is Integer.

Returns:
Returns true if field type is Integer, and false if it is not

Definition at line 66 of file TableField.h.

References p_type.

Referenced by Isis::Blobber::load().

bool Isis::TableField::IsReal (  )  const [inline]

Checks to see if field type is Text.

Returns:
Returns true if field type is Text, and false if it is not

Definition at line 87 of file TableField.h.

References p_type.

bool Isis::TableField::IsText (  )  const [inline]

Checks to see if field type is Text.

Returns:
Returns true if field type is Text, and false if it is not

Definition at line 80 of file TableField.h.

References p_type.

std::string Isis::TableField::Name (  )  const [inline]

Returns the name of the TableField.

Returns:
Name of TableField

Definition at line 59 of file TableField.h.

References p_name.

Isis::TableField::operator double (  )  const

Returns:
Exceptions:
Isis::iException::Programmer - Field is not a Double

Definition at line 109 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_dvalues, p_name, and p_type.

Isis::TableField::operator float (  )  const

Returns:
Exceptions:
Isis::iException::Programmer - Field is not a Real

Definition at line 139 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_name, p_rvalues, and p_type.

Isis::TableField::operator int (  )  const

Returns:
Exceptions:
Isis::iException::Programmer - Field is not an Integer

Definition at line 124 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_ivalues, p_name, and p_type.

Isis::TableField::operator std::string (  )  const

Returns:
Exceptions:
Isis::iException::Programmer - Field is not a string

Definition at line 154 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_name, p_svalue, and p_type.

Isis::TableField::operator std::vector< float > (  )  const

Returns:
Exceptions:
Isis::iException::Programmer - Field is not a Double array

Definition at line 169 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_dvalues, p_name, and p_type.

void Isis::TableField::operator= ( const void *  ibuf  ) 

Parameters:
ibuf 
Exceptions:
Isis::iException::Programmer - Invalid field type

Definition at line 335 of file TableField.cpp.

References _FILEINFO_, Bytes(), Isis::iException::Message(), p_dvalues, p_ivalues, p_rvalues, p_svalue, and p_type.

void Isis::TableField::operator= ( const char *  buf  ) 

Parameters:
buf 
Exceptions:
Isis::iException::Programmer - Field is not Text

Definition at line 380 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_name, p_svalue, and p_type.

void Isis::TableField::operator= ( const std::vector< float > &  values  ) 

Sets field value equal to the input.

Parameters:
values Float vector of values to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not a Real
Isis::iException::Programmer - Vector is not the correct size

Definition at line 316 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_name, p_rvalues, p_size, and p_type.

void Isis::TableField::operator= ( const std::vector< double > &  values  ) 

Sets field value equal to the input.

Parameters:
values Double vector of values to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not a Double
Isis::iException::Programmer - Vector is not the correct size

Definition at line 295 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_dvalues, p_name, p_size, and p_type.

void Isis::TableField::operator= ( const std::vector< int > &  values  ) 

Sets field value equal to input.

Parameters:
values Integer vector of values to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not an Integer
Isis::iException::Programmer - Vector is not the correct size

Definition at line 275 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_ivalues, p_name, p_size, and p_type.

void Isis::TableField::operator= ( const std::string &  value  ) 

Sets field value equal to input.

Parameters:
value string to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not a string

Definition at line 244 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_name, p_svalue, and p_type.

void Isis::TableField::operator= ( const float  value  ) 

Sets field value equal to input.

Parameters:
value float to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not a string

Definition at line 259 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_name, p_rvalues, and p_type.

void Isis::TableField::operator= ( const double  value  ) 

Sets field value equal to input.

Parameters:
value Double to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not a Double

Definition at line 229 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_dvalues, p_name, and p_type.

void Isis::TableField::operator= ( const int  value  ) 

Sets field value equal to input.

Parameters:
value Integer to be assigned to field value
Exceptions:
Isis::iException::Programmer - Field is not an Integer

Definition at line 214 of file TableField.cpp.

References _FILEINFO_, Isis::iException::Message(), p_ivalues, p_name, and p_type.

Isis::PvlGroup Isis::TableField::PvlGroup (  ) 

Creates and returns a PvlGroup named "Field" containing the following keywords and their respective values: "Name", "Type", and "Size".

Returns:
PvlGroup containing field Name, Type, and Size

Definition at line 395 of file TableField.cpp.

References p_name, p_size, and p_type.

int Isis::TableField::Size (  )  const [inline]

Returns the size of the field.

Returns:
The size of the TableField

Definition at line 101 of file TableField.h.

References p_size.


Member Data Documentation

int Isis::TableField::p_bytes [private]

Number of bytes in field.

Definition at line 127 of file TableField.h.

Referenced by Bytes(), and TableField().

std::vector<double> Isis::TableField::p_dvalues [private]

Vector of Double values.

Definition at line 129 of file TableField.h.

Referenced by operator double(), operator std::vector(), operator=(), and TableField().

std::vector<int> Isis::TableField::p_ivalues [private]

Vector of Integer values.

Definition at line 128 of file TableField.h.

Referenced by operator int(), operator=(), and TableField().

std::string Isis::TableField::p_name [private]

Name of field.

Definition at line 124 of file TableField.h.

Referenced by Name(), operator double(), operator float(), operator int(), operator std::string(), operator std::vector(), operator=(), PvlGroup(), and TableField().

std::vector<float> Isis::TableField::p_rvalues [private]

Vector of Real values.

Definition at line 130 of file TableField.h.

Referenced by operator float(), operator=(), and TableField().

int Isis::TableField::p_size [private]

Size of field.

Definition at line 126 of file TableField.h.

Referenced by operator=(), PvlGroup(), Size(), and TableField().

std::string Isis::TableField::p_svalue [private]

string value of field

Definition at line 131 of file TableField.h.

Referenced by operator std::string(), operator=(), and TableField().

Type Isis::TableField::p_type [private]

Type of field.

Definition at line 125 of file TableField.h.

Referenced by IsDouble(), IsInteger(), IsReal(), IsText(), operator double(), operator float(), operator int(), operator std::string(), operator std::vector(), operator=(), PvlGroup(), and TableField().


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