File failed to load: https://isis.astrogeology.usgs.gov/9.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
Isis::TableRecord Class Reference

#include <TableRecord.h>

Collaboration diagram for Isis::TableRecord:
Collaboration graph

Public Member Functions

 TableRecord ()
 Constructs an empty TableRecord object. No member variables are set.
 
 TableRecord (std::string tableRecordStr, char fieldDelimiter, std::vector< QString > fieldNames, int numOfFieldValues)
 TableRecord constructor.
 
 ~TableRecord ()
 Destroys the TableRecord object.
 
void operator+= (Isis::TableField &field)
 Adds a TableField to a TableRecord.
 
TableFieldoperator[] (const int field)
 Returns the TableField at the specified location in the TableRecord.
 
TableFieldoperator[] (const QString &field)
 Returns the TableField in the record whose name corresponds to the input string.
 
int Fields () const
 Returns the number of fields that are currently in the record.
 
int RecordSize () const
 Returns the number of bytes per record.
 
void Pack (char *buf) const
 Writes record information into the binary buffer.
 
void Unpack (const char *buf)
 Reads record information from the binary buffer.
 
void Swap (char *buf) const
 Swaps bytes of the buffer, depending on the TableField::Type.
 

Static Public Member Functions

static QString toString (TableRecord record, QString fieldDelimiter=",", bool fieldNames=false, bool endLine=true)
 

Private Attributes

std::vector< TableFieldp_fields
 Vector of TableFields in the record.
 

Detailed Description

Author
2004-09-01 Jeff Anderson
History

2005-03-18 Elizabeth Ribelin - Added documentation to class

2007-05-28 Steven Lambright - Added 4 byte float capablilities.

2008-06-19 Christopher Austin - Fixed the Packing of text TableFields

2008-06-25 Christopher Austin - Fixed the swapping of text

2012-10-04 Jeannie Backer Changed references to TableField methods in implementation and unitTest files to lower camel case. Added and ordered includes. Moved method implementation to cpp. Fixed header definition statement. Fixed indentation of history entries. Ordered methods in cpp file. Improved test coverage in all categories. Added padding to control statements. References #1169.

2015-10-04 Jeannie Backer Improved coding standards. References #1178

Todo
Finish class documentation

Definition at line 38 of file TableRecord.h.

Constructor & Destructor Documentation

◆ TableRecord() [1/2]

Isis::TableRecord::TableRecord ( )

Constructs an empty TableRecord object. No member variables are set.

Definition at line 22 of file TableRecord.cpp.

◆ TableRecord() [2/2]

Isis::TableRecord::TableRecord ( std::string tableRecordStr,
char fieldDelimiter,
std::vector< QString > fieldNames,
int numOfFieldValues )

TableRecord constructor.

Parameters
tableRecordStrTable record string
fieldDelimiterThe delimiter to separate fields with
fieldNamesTable header names
numOfFieldValuesNumber of fields (rows)

Definition at line 33 of file TableRecord.cpp.

References Isis::TableField::Double, and operator+=().

◆ ~TableRecord()

Isis::TableRecord::~TableRecord ( )

Destroys the TableRecord object.

Definition at line 49 of file TableRecord.cpp.

Member Function Documentation

◆ Fields()

◆ operator+=()

void Isis::TableRecord::operator+= ( Isis::TableField & field)

Adds a TableField to a TableRecord.

Parameters
field- TableField to be added to the record

Definition at line 58 of file TableRecord.cpp.

References p_fields.

Referenced by TableRecord().

◆ operator[]() [1/2]

Isis::TableField & Isis::TableRecord::operator[] ( const int field)

Returns the TableField at the specified location in the TableRecord.

Parameters
fieldIndex of desired field
Returns
The TableField at specified location in the record

Definition at line 69 of file TableRecord.cpp.

References p_fields.

◆ operator[]() [2/2]

TableField & Isis::TableRecord::operator[] ( const QString & field)

Returns the TableField in the record whose name corresponds to the input string.

Parameters
fieldThe name of desired TableField
Returns
The specified TableField
Exceptions
Isis::IException::Programmer- The field does not exist in the record

Definition at line 84 of file TableRecord.cpp.

References p_fields, Isis::IException::Programmer, and Isis::IString::UpCase().

◆ Pack()

void Isis::TableRecord::Pack ( char * buf) const

Writes record information into the binary buffer.

Parameters
bufBuffer to fill with binary record information.
Exceptions
Isis::IException::Programmer- Invalid field type

Definition at line 124 of file TableRecord.cpp.

References Fields(), Isis::TableField::isDouble(), Isis::TableField::isInteger(), Isis::TableField::isReal(), Isis::TableField::isText(), p_fields, Isis::IException::Programmer, and Isis::TableField::size().

Referenced by Isis::Table::operator+=(), and Isis::Table::Update().

◆ RecordSize()

int Isis::TableRecord::RecordSize ( ) const

Returns the number of bytes per record.

Returns
Number of bytes per record

Definition at line 111 of file TableRecord.cpp.

References p_fields.

Referenced by Isis::ExportPdsTable::exportTable(), and Isis::Table::operator+=().

◆ Swap()

void Isis::TableRecord::Swap ( char * buf) const

Swaps bytes of the buffer, depending on the TableField::Type.

Parameters
bufBuffer containing record values to be swapped.
Exceptions
Isis::iException::Programmer- Invalid field type

Definition at line 192 of file TableRecord.cpp.

References Isis::TableField::bytes(), Fields(), Isis::TableField::isDouble(), Isis::TableField::isInteger(), Isis::TableField::isReal(), Isis::TableField::isText(), p_fields, Isis::IException::Programmer, and Isis::TableField::size().

◆ toString()

QString Isis::TableRecord::toString ( TableRecord record,
QString fieldDelimiter = ",",
bool fieldNames = false,
bool endLine = true )
static

Definition at line 254 of file TableRecord.cpp.

◆ Unpack()

void Isis::TableRecord::Unpack ( const char * buf)

Reads record information from the binary buffer.

Parameters
bufBuffer from which to read record field values.

Definition at line 176 of file TableRecord.cpp.

References Isis::TableField::bytes(), Fields(), and p_fields.

Member Data Documentation

◆ p_fields

std::vector<TableField> Isis::TableRecord::p_fields
private

Vector of TableFields in the record.

Definition at line 60 of file TableRecord.h.

Referenced by Fields(), operator+=(), operator[](), operator[](), Pack(), RecordSize(), Swap(), and Unpack().


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