IsisDlm
Version 0.2
|
#include <FileRepository.h>
Public Member Functions | |
int | size () const |
iFile::Iid | addCube (const std::string &filename, Isis::Cube *cube, bool readonly=true) |
iFile::Iid | addPvl (const std::string &filename, Isis::Pvl *pvl, bool readonly=true) |
iFile * | getFile (iFile::Iid id) |
iFile * | getNthFile (int nth=0) |
bool | removeFile (iFile::Iid id) |
void | Purge () |
Static Public Member Functions | |
static FileRepository * | Instance () |
Static Public Attributes | |
static const char *const | ID = "$Revision: 1.3 $ $Date: 2004/11/02 15:38:53 $" |
Class version. |
Protected Member Functions | |
FileRepository () |
Private Member Functions | |
~FileRepository () | |
FileRepository (const FileRepository &k) | |
FileRepository | operator= (const FileRepository &k) |
Private Attributes | |
std::list< iFile * > | _files |
List of maintained files. |
Static Private Attributes | |
static FileRepository * | _instance = 0 |
The all important pointer to itself. |
ISIS DLM File repository This class follows the classic Singleton pattern by the Gang Of Four (GOF). A discussion of this technique can be studied in their book Design Patterns: Elements of Reusable Object-Oriented Software.
This particular class serves as a holding tank for ISIS cube files and PVL like files. Although ISIS files have a PVL label, I distinguish between the two because they require different management schemes.
Isis labels are managed in real time in that all label manipulation is immediate. Any change that results in a modification of the the label content is immediately reflected in the file label (?).
PVL labels are contained within this repository until they are explicitly closed by the user or the program terminates and a purging of the repository is performed.
|
inlineprotected |
Referenced by Instance().
|
private |
|
private |
iFile::Iid ISISDLM::FileRepository::addCube | ( | const std::string & | filename, |
Isis::Cube * | cube, | ||
bool | readonly = true |
||
) |
References _files, and ISISDLM::iFile::getId().
Referenced by ISISDLM::isis_create(), ISISDLM::isis_read(), ISISDLM::isis_read_brick(), ISISDLM::isis_read_image(), ISISDLM::isis_write(), and ISISDLM::isis_write_image().
iFile::Iid ISISDLM::FileRepository::addPvl | ( | const std::string & | filename, |
Isis::Pvl * | pvl, | ||
bool | readonly = true |
||
) |
References _files, and ISISDLM::iFile::getId().
Referenced by ISISDLM::isis_create().
iFile * ISISDLM::FileRepository::getFile | ( | iFile::Iid | id | ) |
iFile * ISISDLM::FileRepository::getNthFile | ( | int | nth = 0 | ) |
References _files.
Referenced by ISISDLM::isis_query().
|
static |
The unique access method This method is the one and only one method that provides access to this object. It maintains an instance of itself by checking to see if the _instance variable is defined. If not it creates an instance of itself and returns a pointer.
Note that the destructor is private to disallow user to delete it. This is forcibly maintained by the compiler.
References _instance, and FileRepository().
Referenced by ISISDLM::isis_close(), ISISDLM::isis_create(), ISISDLM::isis_open(), ISISDLM::isis_query(), ISISDLM::isis_query_key(), ISISDLM::isis_read(), ISISDLM::isis_read_blob(), ISISDLM::isis_read_brick(), ISISDLM::isis_read_image(), ISISDLM::isis_write(), and ISISDLM::isis_write_image().
|
private |
void ISISDLM::FileRepository::Purge | ( | ) |
References _files.
Referenced by IsisTerminate(), and ~FileRepository().
bool ISISDLM::FileRepository::removeFile | ( | iFile::Iid | id | ) |
References _files.
Referenced by ISISDLM::isis_close().
|
inline |
References _files.
Referenced by ISISDLM::isis_query().
|
private |
List of maintained files.
Referenced by addCube(), addPvl(), getFile(), getNthFile(), Purge(), removeFile(), and size().
|
staticprivate |
The all important pointer to itself.
Initialize the internal instance of itself.
Referenced by Instance().
|
static |
Class version.