USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::Blob Class Reference

#include <Blob.h>

Inheritance diagram for Isis::Blob:

Inheritance graph
[legend]
Collaboration diagram for Isis::Blob:

Collaboration graph
[legend]
List of all members.

Detailed Description

For internal use only.

History:
Jeff Anderson 04-04-2006 Class was not overwriting existing blobs correctly.
History:
Elizabeth Miller 02-20-2007 Fixed bug with OriginalLabel naming and modified to be backwards compatible
History:
Steven Lambright Added copy constructor, assignment operator
Todo:
Write class description, history, etc.

Definition at line 41 of file Blob.h.

Public Member Functions

 Blob (const std::string &name, const std::string &type)
 Constructs a Blob object using a name and type.
 Blob (const std::string &name, const std::string &type, const std::string &file)
 Constructs a Blob object using a name, type, and reading Pvl values from a file.
 Blob (const Blob &other)
 This copies the blob object.
virtual ~Blob ()
 Destroys the Blob object.
void Read (const std::string &file)
 This reads Pvl values from a specified file.
virtual void Read (Isis::Pvl &pvl, std::fstream &is)
void Write (const std::string &file)
 Write the blob data out to a file.
void Write (Isis::Pvl &pvl, std::fstream &istm, const std::string &detachedFilename="")
 Write the blob data out to a Pvl object.
std::string Type () const
std::string Name () const
PvlObjectLabel ()
Bloboperator= (const Blob &other)
 This makes the two blob objects exactly the same (copies the blob).

Protected Member Functions

void Find (Isis::Pvl &pvl)
virtual void ReadInit ()
virtual void ReadData (std::fstream &is)
 Read binary data from an input stream into the Blob.
virtual void WriteInit ()
virtual void WriteData (std::fstream &os)
 Writes blob data to a stream.

Protected Attributes

Isis::PvlObject p_blobPvl
 Pvl Blob object.
std::string p_blobName
 Name of the Blob object.
char * p_buffer
 Buffer blob data is stored in.
BigInt p_startByte
 Byte blob data starts at in buffer.
int p_nbytes
 Size of blob data (in bytes).
std::string p_type
 Type of data stored in the buffer.
std::string p_detached
 Used for reading detached blobs.
std::string p_labelFile
 The file containing the labels.


Constructor & Destructor Documentation

Isis::Blob::Blob ( const std::string &  name,
const std::string &  type 
)

Constructs a Blob object using a name and type.

Parameters:
name The blob name
type The blob type

Definition at line 43 of file Blob.cpp.

References p_blobName, p_blobPvl, p_buffer, p_labelFile, p_nbytes, p_type, and Isis::PvlContainer::SetName().

Isis::Blob::Blob ( const std::string &  name,
const std::string &  type,
const std::string &  file 
)

Constructs a Blob object using a name, type, and reading Pvl values from a file.

Parameters:
name The blob name
type The blob type
file The filename to read from.

Definition at line 64 of file Blob.cpp.

References p_blobName, p_buffer, p_labelFile, p_nbytes, p_type, and Read().

Isis::Blob::Blob ( const Blob other  ) 

This copies the blob object.

Parameters:
other 

Definition at line 79 of file Blob.cpp.

References p_blobName, p_blobPvl, p_buffer, p_detached, p_labelFile, p_nbytes, p_startByte, and p_type.

Isis::Blob::~Blob (  )  [virtual]

Destroys the Blob object.

Definition at line 100 of file Blob.cpp.

References p_buffer.


Member Function Documentation

Blob & Isis::Blob::operator= ( const Blob other  ) 

This makes the two blob objects exactly the same (copies the blob).

Parameters:
other 
Returns:
Blob&

Definition at line 111 of file Blob.cpp.

References p_blobName, p_blobPvl, p_buffer, p_detached, p_labelFile, p_nbytes, p_startByte, and p_type.

void Isis::Blob::Read ( const std::string &  file  ) 

This reads Pvl values from a specified file.

Parameters:
file The filename to read from.
Exceptions:
Isis::iException::Io - Unable to open file
Isis::iException::Pvl - Invalid label format

Definition at line 141 of file Blob.cpp.

References _FILEINFO_, e, Isis::Message::FileOpen(), in, Isis::iException::Message(), p_blobName, p_type, and pvl().

Referenced by Blob(), Isis::History::History(), Isis::OriginalLabel::OriginalLabel(), Isis::OriginalLabel::Read(), Isis::History::Read(), Isis::Cube::Read(), and Isis::Table::Table().

void Isis::Blob::ReadData ( std::fstream &  stream  )  [protected, virtual]

Read binary data from an input stream into the Blob.

Parameters:
stream The input stream to read from.
Exceptions:
Isis::iException::Io - Error reading data from stream

Reimplemented in Isis::ImagePolygon, and Isis::Table.

Definition at line 267 of file Blob.cpp.

References _FILEINFO_, Isis::iException::Message(), p_blobName, p_buffer, p_nbytes, p_startByte, and p_type.

Referenced by Read().

void Isis::Blob::Write ( Isis::Pvl pvl,
std::fstream &  stm,
const std::string &  detachedFilename = "" 
)

Write the blob data out to a Pvl object.

Parameters:
pvl The pvl object to update
stm stream to write data to
detachedFilename If the stream is detached from the labels give the name of the file

Definition at line 345 of file Blob.cpp.

References Isis::PvlContainer::DeleteKeyword(), Isis::PvlContainer::Name(), p_blobPvl, p_nbytes, p_type, pvl(), WriteData(), and WriteInit().

void Isis::Blob::Write ( const std::string &  file  ) 

Write the blob data out to a file.

Parameters:
file The filename to write to.
Exceptions:
Isis::iException::Io - Unable to open file
Isis::iException::Io - Error preparing to write data to file
Isis::iException::Io - Error creating file

Definition at line 296 of file Blob.cpp.

References _FILEINFO_, e, in, Isis::iException::Message(), p_blobName, p_blobPvl, p_nbytes, p_startByte, p_type, pvl(), WriteData(), and WriteInit().

Referenced by Isis::Cube::Write().

void Isis::Blob::WriteData ( std::fstream &  stream  )  [protected, virtual]

Writes blob data to a stream.

Parameters:
stream Output steam blob data will be written to
Exceptions:
Isis::iException::Io - Error writing data to stream

Reimplemented in Isis::ImagePolygon, and Isis::Table.

Definition at line 422 of file Blob.cpp.

References _FILEINFO_, Isis::iException::Message(), p_blobName, p_buffer, p_nbytes, and p_type.

Referenced by Write().


Member Data Documentation

std::string Isis::Blob::p_blobName [protected]

Name of the Blob object.

Definition at line 72 of file Blob.h.

Referenced by Blob(), Find(), Name(), operator=(), Read(), Isis::Table::ReadData(), Isis::ImagePolygon::ReadData(), ReadData(), Write(), and WriteData().

Isis::PvlObject Isis::Blob::p_blobPvl [protected]

Pvl Blob object.

Definition at line 71 of file Blob.h.

Referenced by Blob(), Find(), Label(), operator=(), Isis::Table::ReadInit(), Isis::Table::Table(), Write(), and Isis::Table::WriteInit().

char* Isis::Blob::p_buffer [protected]

Buffer blob data is stored in.

Definition at line 74 of file Blob.h.

Referenced by Blob(), operator=(), ReadData(), Isis::History::ReturnHist(), Isis::OriginalLabel::ReturnLabels(), WriteData(), Isis::OriginalLabel::WriteInit(), Isis::History::WriteInit(), and ~Blob().

std::string Isis::Blob::p_detached [protected]

Used for reading detached blobs.

Definition at line 78 of file Blob.h.

Referenced by Blob(), Find(), operator=(), and Read().

std::string Isis::Blob::p_labelFile [protected]

The file containing the labels.

Definition at line 79 of file Blob.h.

Referenced by Blob(), Find(), and operator=().

int Isis::Blob::p_nbytes [protected]

Size of blob data (in bytes).

Definition at line 76 of file Blob.h.

Referenced by Blob(), Find(), operator=(), Isis::ImagePolygon::ReadData(), ReadData(), Isis::History::ReturnHist(), Isis::OriginalLabel::ReturnLabels(), Write(), Isis::ImagePolygon::WriteData(), WriteData(), Isis::Table::WriteInit(), Isis::OriginalLabel::WriteInit(), Isis::ImagePolygon::WriteInit(), and Isis::History::WriteInit().

BigInt Isis::Blob::p_startByte [protected]

Byte blob data starts at in buffer.

Definition at line 75 of file Blob.h.

Referenced by Blob(), Find(), operator=(), Isis::Table::ReadData(), Isis::ImagePolygon::ReadData(), ReadData(), and Write().

std::string Isis::Blob::p_type [protected]

Type of data stored in the buffer.

Definition at line 77 of file Blob.h.

Referenced by Blob(), Find(), operator=(), Read(), Isis::ImagePolygon::ReadData(), ReadData(), Type(), Write(), and WriteData().


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