FileDescriptor Class Reference

Describes how a data element is stored in a file on disk. More...

#include <FileDescriptor.h>

Inheritance diagram for FileDescriptor:

Inheritance graph

List of all members.

Public Member Functions

virtual void setFilename (const std::string &filename)=0
virtual void setFilename (const Filename &filename)=0
virtual const FilenamegetFilename () const =0
virtual void setDatasetLocation (const std::string &datasetLocation)=0
virtual const std::string & getDatasetLocation () const =0
virtual void setEndian (EndianType endian)=0
virtual EndianType getEndian () const =0
virtual FileDescriptorcopy () const =0
virtual bool clone (const FileDescriptor *pFileDescriptor)=0
virtual void addToMessageLog (Message *pMessage) const =0

Static Public Member Functions

static const std::string & signalFilenameChanged ()
static const std::string & signalDatasetLocationChanged ()
static const std::string & signalEndianChanged ()

Protected Member Functions

virtual ~FileDescriptor ()


Detailed Description

Describes how a data element is stored in a file on disk.

A file descriptor contains data that describes how a data element is stored on-disk, including the filename. There are two primary uses for a file descriptor:

If a DataElement is created by an algorithm and was not imported from a file, the element's data descriptor will have a NULL file descriptor.

See also:
DataElement, DataDescriptor, DataDescriptor::setFileDescriptor()
This subclass of Subject will notify upon the following conditions:

Definition at line 49 of file FileDescriptor.h.


Constructor & Destructor Documentation

virtual FileDescriptor::~FileDescriptor (  )  [protected, virtual]

This should be destroyed by calling ObjectFactory::destroyObject.

Definition at line 216 of file FileDescriptor.h.


Member Function Documentation

static const std::string& FileDescriptor::signalFilenameChanged (  )  [static]

Emitted when the filename changes with boost::any<Filename*> containing a pointer to the new filename.

See also:
setFilename()

Definition at line 59 of file FileDescriptor.h.

static const std::string& FileDescriptor::signalDatasetLocationChanged (  )  [static]

Emitted when the data set location changes with boost::any<std::string> containing the new data set location.

See also:
setDatasetLocation()

Definition at line 67 of file FileDescriptor.h.

static const std::string& FileDescriptor::signalEndianChanged (  )  [static]

Emitted when the endian changes with boost::any<EndianType> containing the new endian value.

See also:
setEndian()

Definition at line 76 of file FileDescriptor.h.

virtual void FileDescriptor::setFilename ( const std::string &  filename  )  [pure virtual]

Sets the location on disk for the file data.

Parameters:
filename The location on disk of the file data.
Subject Notifications:
This method notifies signalFilenameChanged() when the filename is successfully changed.
See also:
setFilename(const Filename&)

virtual void FileDescriptor::setFilename ( const Filename filename  )  [pure virtual]

Sets the location on disk for the file data.

Parameters:
filename The Filename object containing the location on disk of the file data.
Subject Notifications:
This method notifies signalFilenameChanged() when the filename is successfully changed.
See also:
setFilename(const std::string&)

virtual const Filename& FileDescriptor::getFilename (  )  const [pure virtual]

Returns the location on disk for the file data.

Returns:
The Filename object containing the location on disk of the file data.

virtual void FileDescriptor::setDatasetLocation ( const std::string &  datasetLocation  )  [pure virtual]

Sets the location of the data set within the file.

The data set location is a string representation of where the data set resides within the file returned by getFilename(). This is useful when a single file contains multiple data sets. The default value is an empty string.

Parameters:
datasetLocation The string representation of where the data set resides within the file on disk.
Subject Notifications:
This method notifies signalDatasetLocationChanged() when the data set location is successfully changed.
See also:
setFilename(const std::string&)

virtual const std::string& FileDescriptor::getDatasetLocation (  )  const [pure virtual]

Returns the location of the data set within the file.

Returns:
The string representation of where the data set resides within the file on disk. An empty string is returned if a location has not been set, which may indicate that the file only contains one data set.

virtual void FileDescriptor::setEndian ( EndianType  endian  )  [pure virtual]

Sets the endian format of the data on disk.

This method sets the endian format of how the data is stored on disk. An importer uses this value to determine whether to swap bytes when importing the data.

Parameters:
endian The endian format of the data on disk.
Subject Notifications:
This method notifies signalEndianChanged() when the endian value is successfully changed.

virtual EndianType FileDescriptor::getEndian (  )  const [pure virtual]

Returns the endian format of the data on disk.

Returns:
The endian format of the data on disk.

virtual FileDescriptor* FileDescriptor::copy (  )  const [pure virtual]

Creates a new file descriptor based on this file descriptor.

This method creates a new file descriptor and sets the values of the created descriptor to this object's values.

Returns:
The new file descriptor containing values identical to the values in this file descriptor.
See also:
clone()

virtual bool FileDescriptor::clone ( const FileDescriptor pFileDescriptor  )  [pure virtual]

Sets all values in this file descriptor to those of another file descriptor.

Parameters:
pFileDescriptor The file descriptor from which to set all data values in this file descriptor. No signal/slot attachments currently defined in pFileDescriptor are set into this descriptor. This method does nothing and returns false if NULL is passed in.
Returns:
Returns true if all values in this file descriptor were successfully set to the values in the given file descriptor; otherwise returns false.
Subject Notifications:
This method notifies one or more signals defined in this class or its subclasses based on data values that are actually changed.
See also:
copy()

virtual void FileDescriptor::addToMessageLog ( Message pMessage  )  const [pure virtual]

Adds the current values in this file descriptor to a given message.

This convenience method adds the values in this file descriptor as properties to the given message in a message log.

Parameters:
pMessage The message in the message log for which to add this file descriptor's values.


Software Development Kit - Opticks 4.9.0 Build 16218