PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Types | Private Member Functions
PLearn::TemporaryFileVMatrix Class Reference

The first sentence should be a BRIEF DESCRIPTION of what the class does. More...

#include <TemporaryFileVMatrix.h>

Inheritance diagram for PLearn::TemporaryFileVMatrix:
Inheritance graph
[legend]
Collaboration diagram for PLearn::TemporaryFileVMatrix:
Collaboration graph
[legend]

List of all members.

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 OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual TemporaryFileVMatrixdeepCopy (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 PPathdeclaringFile ()

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.

Detailed Description

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

Todo:
Synchronize this help with the C++ embedded help.

Definition at line 59 of file TemporaryFileVMatrix.h.


Member Typedef Documentation

Reimplemented from PLearn::FileVMatrix.

Definition at line 61 of file TemporaryFileVMatrix.h.


Constructor & Destructor Documentation

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.

{}
PLearn::TemporaryFileVMatrix::TemporaryFileVMatrix ( const PPath filename,
bool  writable = true 
)

Convenient constructors.

Definition at line 66 of file TemporaryFileVMatrix.cc.

References build_().

                                                         :
    inherited(filename, writable)
{
    build_();
}

Here is the call graph for this function:

PLearn::TemporaryFileVMatrix::TemporaryFileVMatrix ( const PPath filename,
int  the_length,
int  the_width 
)

Definition at line 73 of file TemporaryFileVMatrix.cc.

References build_().

                                                                         :
    inherited(filename, the_length, the_width)
{
    build_();
}

Here is the call graph for this function:

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 = "";
        }
    }
}

Here is the call graph for this function:


Member Function Documentation

string PLearn::TemporaryFileVMatrix::_classname_ ( ) [static]

FileVMatrix.

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.

bool PLearn::TemporaryFileVMatrix::_isa_ ( const Object o) [static]

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_();
}

Here is the call graph for this function:

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_);
}

Here is the call graph for this function:

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

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);
}

Here is the call graph for this function:

static const PPath& PLearn::TemporaryFileVMatrix::declaringFile ( ) [inline, static]

Reimplemented from PLearn::FileVMatrix.

Definition at line 87 of file TemporaryFileVMatrix.h.

:

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);
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::FileVMatrix.

Definition at line 87 of file TemporaryFileVMatrix.h.

Definition at line 98 of file TemporaryFileVMatrix.h.

Referenced by build_(), closeCurrentFile(), and makeDeepCopyFromShallowCopy().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines