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

#include <PTest.h>

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

List of all members.

Public Member Functions

 PTest ()
 Default constructor.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual PTestdeepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.
virtual void makeDeepCopyFromShallowCopy (CopiesMap &copies)
 Transforms a shallow copy into a deep copy.
virtual void perform ()
 The test must be performed in this (virtual) method.
virtual void run ()
 Launch the test, by: 1.

Static Public Member Functions

static string _classname_ ()
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 ()

Public Attributes

string name
bool save
PPath save_path

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

static void declareOptions (OptionList &ol)
 Declares the class options.

Private Types

typedef Object inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

Todo:
Synchronize Doxygen help with C++ help.

Definition at line 54 of file PTest.h.


Member Typedef Documentation

typedef Object PLearn::PTest::inherited [private]

Constructor & Destructor Documentation

PLearn::PTest::PTest ( )

Default constructor.

Definition at line 61 of file PTest.cc.

            :
    save(true)
{}

Member Function Documentation

string PLearn::PTest::_classname_ ( ) [static]
OptionList & PLearn::PTest::_getOptionList_ ( ) [static]
RemoteMethodMap & PLearn::PTest::_getRemoteMethodMap_ ( ) [static]
bool PLearn::PTest::_isa_ ( const Object o) [static]
Object * PLearn::PTest::_new_instance_for_typemap_ ( ) [static]
StaticInitializer PTest::_static_initializer_ & PLearn::PTest::_static_initialize_ ( ) [static]
void PLearn::PTest::build ( ) [virtual]
void PLearn::PTest::build_ ( ) [private]
string PLearn::PTest::classname ( ) const [virtual]
void PLearn::PTest::declareOptions ( OptionList ol) [static, protected]

Declares the class options.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::ObjectGraphIteratorTest, PLearn::PLCheckTest, PLearn::PLStringutilsTest, PLearn::PPTest, PLearn::PLLogTest, PLearn::PPathTest, PLearn::PStreamBufTest, PLearn::TupleTest, PLearn::PentaTest, PLearn::PLMathTest, PLearn::TMatTest, PLearn::RemoveObservationTest, PLearn::HeapTest, PLearn::ConjRosenbrock, PLearn::BasicIdentityCallsTest, PLearn::InjectionTest, PLearn::InstanceSnippetTest, PLearn::InterfunctionXchgTest, PLearn::MemoryStressTest, PLearn::VariablesTest, PLearn::VarUtilsTest, PLearn::AutoVMatrixTest, PLearn::FileVMatrixTest, PLearn::IndexedVMatrixTest, PLearn::RowBufferedVMatrixTest, and PLearn::MaxSubsamplingTest.

Definition at line 94 of file PTest.cc.

References PLearn::OptionBase::buildoption, PLearn::declareOption(), PLearn::Object::declareOptions(), name, PLearn::OptionBase::nosave, save, and save_path.

Referenced by PLearn::TMatTest::declareOptions(), PLearn::MemoryStressTest::declareOptions(), PLearn::HeapTest::declareOptions(), and PLearn::ConjRosenbrock::declareOptions().

{
    // Option 'name' is declared as 'nosave' because most PTest subclasses will
    // either use the default name (= classname()), or set their own name,
    // without needing to have the user set it by himself.
    // However, a subclass may redeclare this option as a 'buildoption' if
    // needed.
    declareOption(ol, "name", &PTest::name, OptionBase::nosave,
        "The name of this test. If left empty, it will be set to classname()\n"
        "at build time.");

    declareOption(ol, "save", &PTest::save, OptionBase::buildoption,
        "If set to 1, this object will be saved to 'save_path'.");

    declareOption(ol, "save_path", &PTest::save_path, OptionBase::buildoption,
        "The file where this test object should be saved (if empty, it will\n"
        "be set to 'name'.psave).");

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static const PPath& PLearn::PTest::declaringFile ( ) [inline, static]
PTest * PLearn::PTest::deepCopy ( CopiesMap copies) const [virtual]
OptionList & PLearn::PTest::getOptionList ( ) const [virtual]
OptionMap & PLearn::PTest::getOptionMap ( ) const [virtual]
RemoteMethodMap & PLearn::PTest::getRemoteMethodMap ( ) const [virtual]
void PLearn::PTest::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::Object.

Reimplemented in PLearn::ObjectGraphIteratorTest, PLearn::PLCheckTest, PLearn::PLStringutilsTest, PLearn::PPTest, PLearn::PLLogTest, PLearn::PPathTest, PLearn::PStreamBufTest, PLearn::TupleTest, PLearn::PentaTest, PLearn::PLMathTest, PLearn::TMatTest, PLearn::RemoveObservationTest, PLearn::HeapTest, PLearn::ConjRosenbrock, PLearn::BasicIdentityCallsTest, PLearn::InjectionTest, PLearn::InstanceSnippetTest, PLearn::InterfunctionXchgTest, PLearn::MemoryStressTest, PLearn::VariablesTest, PLearn::VarUtilsTest, PLearn::AutoVMatrixTest, PLearn::FileVMatrixTest, PLearn::IndexedVMatrixTest, PLearn::RowBufferedVMatrixTest, and PLearn::MaxSubsamplingTest.

Definition at line 77 of file PTest.cc.

References PLearn::Object::makeDeepCopyFromShallowCopy(), and PLERROR.

Referenced by PLearn::TMatTest::makeDeepCopyFromShallowCopy(), PLearn::MemoryStressTest::makeDeepCopyFromShallowCopy(), PLearn::HeapTest::makeDeepCopyFromShallowCopy(), and PLearn::ConjRosenbrock::makeDeepCopyFromShallowCopy().

{
    inherited::makeDeepCopyFromShallowCopy(copies);

    // ### Call deepCopyField on all "pointer-like" fields 
    // ### that you wish to be deepCopied rather than 
    // ### shallow-copied.
    // ### ex:
    // deepCopyField(trainvec, copies);

    // ### Remove this line when you have fully implemented this method.
    PLERROR("PTest::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void PLearn::PTest::perform ( ) [inline, virtual]
void PLearn::PTest::run ( ) [virtual]

Launch the test, by: 1.

Calling the perform() method 2. Saving this object (whose options should contains the test results)

Reimplemented from PLearn::Object.

Definition at line 128 of file PTest.cc.

References PLearn::PPath::errorDisplay(), PLearn::PPath::isEmpty(), name, PLearn::pathexists(), perform(), PLERROR, save, and save_path.

{
    this->perform();
    if (save) {
        PPath file = save_path.isEmpty() ? PPath(name + ".psave") : save_path;
        if (pathexists(file))
            PLERROR("In PTest::run - File '%s' already exists",
                    file.errorDisplay().c_str());
        PP<PTest> test_to_save = this;
        PLearn::save(file, test_to_save);
    }
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 61 of file PTest.h.

Referenced by build_(), declareOptions(), and run().

Definition at line 62 of file PTest.h.

Referenced by declareOptions(), and run().

Definition at line 63 of file PTest.h.

Referenced by declareOptions(), and run().


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