|
PLearn 0.1
|
The first sentence should be a BRIEF DESCRIPTION of what the class does. More...
#include <TemporaryFileVMatrix.h>


Public Member Functions | |
| TemporaryFileVMatrix () | |
| ### declare public option fields (such as build options) here Start your comments with Doxygen-compatible comments such as //! | |
| TemporaryFileVMatrix (const PPath &filename, bool writable=true) | |
| Convenient constructors. | |
| TemporaryFileVMatrix (const PPath &filename, int the_length, int the_width) | |
| virtual | ~TemporaryFileVMatrix () |
| Destructor. | |
| virtual string | classname () const |
| virtual OptionList & | getOptionList () const |
| virtual OptionMap & | getOptionMap () const |
| virtual RemoteMethodMap & | getRemoteMethodMap () const |
| virtual TemporaryFileVMatrix * | deepCopy (CopiesMap &copies) const |
| virtual void | build () |
| Simply calls inherited::build() then build_(). | |
| virtual void | makeDeepCopyFromShallowCopy (CopiesMap &copies) |
| Transforms a shallow copy into a deep copy. | |
Static Public Member Functions | |
| static string | _classname_ () |
| FileVMatrix. | |
| static OptionList & | _getOptionList_ () |
| static RemoteMethodMap & | _getRemoteMethodMap_ () |
| static Object * | _new_instance_for_typemap_ () |
| static bool | _isa_ (const Object *o) |
| static void | _static_initialize_ () |
| static const PPath & | declaringFile () |
Static Public Attributes | |
| static StaticInitializer | _static_initializer_ |
Protected Member Functions | |
| virtual void | closeCurrentFile () |
| Overridden to properly update the counter of references to the file. | |
Static Protected Member Functions | |
| static void | declareOptions (OptionList &ol) |
| Declares the class options. | |
Protected Attributes | |
| PPath | last_filename |
Private Types | |
| typedef FileVMatrix | inherited |
Private Member Functions | |
| void | build_ () |
| This does the actual building. | |
The first sentence should be a BRIEF DESCRIPTION of what the class does.
Place the rest of the class programmer documentation here. Doxygen supports Javadoc-style comments. See http://www.doxygen.org/manual.html
Definition at line 59 of file TemporaryFileVMatrix.h.
typedef FileVMatrix PLearn::TemporaryFileVMatrix::inherited [private] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 61 of file TemporaryFileVMatrix.h.
| PLearn::TemporaryFileVMatrix::TemporaryFileVMatrix | ( | ) |
### declare public option fields (such as build options) here Start your comments with Doxygen-compatible comments such as //!
Default constructor
Definition at line 63 of file TemporaryFileVMatrix.cc.
{}
Convenient constructors.
Definition at line 66 of file TemporaryFileVMatrix.cc.
References build_().

| PLearn::TemporaryFileVMatrix::TemporaryFileVMatrix | ( | const PPath & | filename, |
| int | the_length, | ||
| int | the_width | ||
| ) |
Definition at line 73 of file TemporaryFileVMatrix.cc.
References build_().

| PLearn::TemporaryFileVMatrix::~TemporaryFileVMatrix | ( | ) | [virtual] |
Destructor.
Definition at line 151 of file TemporaryFileVMatrix.cc.
References closeCurrentFile(), PLearn::FileVMatrix::filename_, PLearn::force_rmdir(), PLearn::VMatrix::getMetaDataDir(), PLearn::VMatrix::hasMetaDataDir(), PLearn::VMatrix::metadatadir, PLearn::noReferenceToFile(), and PLearn::rm().
{
TemporaryFileVMatrix::closeCurrentFile();
if (noReferenceToFile(filename_)) {
rm(filename_);
if (hasMetaDataDir()) {
force_rmdir(getMetaDataDir());
// Clear the metadatadir so that the parent class does not try to
// do anything with it.
metadatadir = "";
}
}
}

| string PLearn::TemporaryFileVMatrix::_classname_ | ( | ) | [static] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| OptionList & PLearn::TemporaryFileVMatrix::_getOptionList_ | ( | ) | [static] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| RemoteMethodMap & PLearn::TemporaryFileVMatrix::_getRemoteMethodMap_ | ( | ) | [static] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| Object * PLearn::TemporaryFileVMatrix::_new_instance_for_typemap_ | ( | ) | [static] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| StaticInitializer TemporaryFileVMatrix::_static_initializer_ & PLearn::TemporaryFileVMatrix::_static_initialize_ | ( | ) | [static] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| void PLearn::TemporaryFileVMatrix::build | ( | ) | [virtual] |
Simply calls inherited::build() then build_().
Reimplemented from PLearn::FileVMatrix.
Definition at line 103 of file TemporaryFileVMatrix.cc.
References PLearn::FileVMatrix::build(), and build_().
{
// ### Nothing to add here, simply calls build_
inherited::build();
build_();
}

| void PLearn::TemporaryFileVMatrix::build_ | ( | ) | [private] |
This does the actual building.
Reimplemented from PLearn::FileVMatrix.
Definition at line 113 of file TemporaryFileVMatrix.cc.
References PLearn::addReferenceToFile(), PLearn::FileVMatrix::f, PLearn::FileVMatrix::filename_, last_filename, and PLearn::VMatrix::updateMtime().
Referenced by build(), and TemporaryFileVMatrix().
{
if (f) {
// File has been opened successfully.
addReferenceToFile(filename_);
last_filename = filename_;
} else
last_filename = "";
updateMtime(filename_);
}


| string PLearn::TemporaryFileVMatrix::classname | ( | ) | const [virtual] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| void PLearn::TemporaryFileVMatrix::closeCurrentFile | ( | ) | [protected, virtual] |
Overridden to properly update the counter of references to the file.
Reimplemented from PLearn::FileVMatrix.
Definition at line 127 of file TemporaryFileVMatrix.cc.
References PLearn::FileVMatrix::closeCurrentFile(), PLearn::FileVMatrix::f, last_filename, and PLearn::removeReferenceToFile().
Referenced by ~TemporaryFileVMatrix().
{
if (f)
removeReferenceToFile(last_filename);
inherited::closeCurrentFile();
}


| void PLearn::TemporaryFileVMatrix::declareOptions | ( | OptionList & | ol | ) | [static, protected] |
Declares the class options.
Reimplemented from PLearn::FileVMatrix.
Definition at line 83 of file TemporaryFileVMatrix.cc.
References PLearn::FileVMatrix::declareOptions().
{
// ### Declare all of this object's options here
// ### For the "flags" of each option, you should typically specify
// ### one of OptionBase::buildoption, OptionBase::learntoption or
// ### OptionBase::tuningoption. Another possible flag to be combined with
// ### is OptionBase::nosave
// ### ex:
// declareOption(ol, "myoption", &TemporaryFileVMatrix::myoption, OptionBase::buildoption,
// "Help text describing this option");
// ...
// Now call the parent class' declareOptions
inherited::declareOptions(ol);
}

| static const PPath& PLearn::TemporaryFileVMatrix::declaringFile | ( | ) | [inline, static] |
| TemporaryFileVMatrix * PLearn::TemporaryFileVMatrix::deepCopy | ( | CopiesMap & | copies | ) | const [virtual] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| OptionList & PLearn::TemporaryFileVMatrix::getOptionList | ( | ) | const [virtual] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| OptionMap & PLearn::TemporaryFileVMatrix::getOptionMap | ( | ) | const [virtual] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| RemoteMethodMap & PLearn::TemporaryFileVMatrix::getRemoteMethodMap | ( | ) | const [virtual] |
Reimplemented from PLearn::FileVMatrix.
Definition at line 58 of file TemporaryFileVMatrix.cc.
| void PLearn::TemporaryFileVMatrix::makeDeepCopyFromShallowCopy | ( | CopiesMap & | copies | ) | [virtual] |
Transforms a shallow copy into a deep copy.
Reimplemented from PLearn::FileVMatrix.
Definition at line 137 of file TemporaryFileVMatrix.cc.
References last_filename, and PLearn::FileVMatrix::makeDeepCopyFromShallowCopy().
{
// Clearing 'last_filename' is important: since at this point it is a
// shallow copy, the file pointed by 'last_filename' has not actually
// been opened by this object, thus there is no need to decrease its
// number of references when build() is called in the parent
// makeDeepCopyFromShallowCopy(..) method.
last_filename = "";
inherited::makeDeepCopyFromShallowCopy(copies);
}

Reimplemented from PLearn::FileVMatrix.
Definition at line 87 of file TemporaryFileVMatrix.h.
PPath PLearn::TemporaryFileVMatrix::last_filename [protected] |
Definition at line 98 of file TemporaryFileVMatrix.h.
Referenced by build_(), closeCurrentFile(), and makeDeepCopyFromShallowCopy().
1.7.4