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

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

#include <PLStringutilsTest.h>

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

List of all members.

Public Member Functions

 PLStringutilsTest ()
 Default constructor.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual PLStringutilsTestdeepCopy (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 method performing the test.

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

Static Public Attributes

static StaticInitializer _static_initializer_

Static Protected Member Functions

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

Private Types

typedef PTest 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:
Write class to-do's here if there are any.
Deprecated:
Write deprecated stuff here if there is any. Indicate what else should be used instead.

Definition at line 57 of file PLStringutilsTest.h.


Member Typedef Documentation

Reimplemented from PLearn::PTest.

Definition at line 59 of file PLStringutilsTest.h.


Constructor & Destructor Documentation

PLearn::PLStringutilsTest::PLStringutilsTest ( )

Default constructor.

Definition at line 55 of file PLStringutilsTest.cc.

{}

Member Function Documentation

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

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

OptionList & PLearn::PLStringutilsTest::_getOptionList_ ( ) [static]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

RemoteMethodMap & PLearn::PLStringutilsTest::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

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

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

Object * PLearn::PLStringutilsTest::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

StaticInitializer PLStringutilsTest::_static_initializer_ & PLearn::PLStringutilsTest::_static_initialize_ ( ) [static]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

void PLearn::PLStringutilsTest::build ( ) [virtual]

Post-constructor.

The normal implementation should call simply inherited::build(), then this class's build_(). This method should be callable again at later times, after modifying some option fields to change the "architecture" of the object.

Reimplemented from PLearn::PTest.

Definition at line 61 of file PLStringutilsTest.cc.

void PLearn::PLStringutilsTest::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::PTest.

Definition at line 99 of file PLStringutilsTest.cc.

{
}
string PLearn::PLStringutilsTest::classname ( ) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

void PLearn::PLStringutilsTest::declareOptions ( OptionList ol) [static, protected]

Declares the class options.

Reimplemented from PLearn::PTest.

Definition at line 84 of file PLStringutilsTest.cc.

{
    // ### ex:
    // declareOption(ol, "myoption", &PLStringutilsTest::myoption,
    //               OptionBase::buildoption,
    //               "Help text describing this option");
    // ...

    // Now call the parent class' declareOptions
    inherited::declareOptions(ol);
}
static const PPath& PLearn::PLStringutilsTest::declaringFile ( ) [inline, static]

Reimplemented from PLearn::PTest.

Definition at line 84 of file PLStringutilsTest.h.

:
    //#####  Protected Options  ###############################################
PLStringutilsTest * PLearn::PLStringutilsTest::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

OptionList & PLearn::PLStringutilsTest::getOptionList ( ) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

OptionMap & PLearn::PLStringutilsTest::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

RemoteMethodMap & PLearn::PLStringutilsTest::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::PTest.

Definition at line 50 of file PLStringutilsTest.cc.

void PLearn::PLStringutilsTest::makeDeepCopyFromShallowCopy ( CopiesMap copies) [virtual]

Transforms a shallow copy into a deep copy.

Reimplemented from PLearn::PTest.

Definition at line 70 of file PLStringutilsTest.cc.

References PLERROR.

{
    inherited::makeDeepCopyFromShallowCopy(copies);

    // ### ex:
    // deepCopyField(trainvec, copies);

    // ### Remove this line when you have fully implemented this method.
    PLERROR("PLStringutilsTest::makeDeepCopyFromShallowCopy not fully (correctly) implemented yet!");
}
void PLearn::PLStringutilsTest::perform ( ) [virtual]

The method performing the test.

A typical test consists in some output (to pout and / or perr), and updates of this object's options.

Reimplemented from PLearn::PTest.

Definition at line 106 of file PLStringutilsTest.cc.

References PLearn::addprepostfix(), PLearn::endl(), PLearn::pout, PLearn::string_begins_with(), and PLearn::string_ends_with().

{
    // Currently only test the 'begins_with' and 'ends_with' functions.
    // More tests may (should!) be added in the future.
    string s1 = "Hello";
    string s2 = "Hello World";
    string s3 = "Hell no!";
    string s4 = "Say Hello";
    string s5 = "Say Hello!";
    string s6 = "Say Jello";
    string s7 = "Hello\n \n\nWorld\n";
    string s8 = "\nHello\nWorld";
    pout << string_begins_with(s2, s1) << endl;
    pout << string_begins_with(s3, s1) << endl;
    pout << string_ends_with(s4, s1) << endl;
    pout << string_ends_with(s5, s1) << endl;
    pout << string_ends_with(s6, s1) << endl;
    pout << addprepostfix("pre-", s7, "-post") << endl;
    pout << addprepostfix("pre-", s8, "-post") << endl;
}

Here is the call graph for this function:


Member Data Documentation

Reimplemented from PLearn::PTest.

Definition at line 84 of file PLStringutilsTest.h.


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