PLearn 0.1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions
PLearn::TypedParentableObject< ParentT > Class Template Reference

#include <ParentableObject.h>

Inheritance diagram for PLearn::TypedParentableObject< ParentT >:
Inheritance graph
[legend]
Collaboration diagram for PLearn::TypedParentableObject< ParentT >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 TypedParentableObject (bool adoptive_parent=false, ParentKind=WeakParent)
 Default constructor.
ParentT * parent ()
 Typed version of parent accessor (hides the inherited one; this is OK)
const ParentT * parent () const
virtual void checkParent () const
 Override to ensure that the assumed parent type is satisfied.
virtual string classname () const
virtual OptionListgetOptionList () const
virtual OptionMapgetOptionMap () const
virtual RemoteMethodMapgetRemoteMethodMap () const
virtual TypedParentableObject
< ParentT > * 
deepCopy (CopiesMap &copies) const
virtual void build ()
 Post-constructor.

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_

Private Types

typedef ParentableObject inherited

Private Member Functions

void build_ ()
 This does the actual building.

Detailed Description

template<class ParentT>
class PLearn::TypedParentableObject< ParentT >

Definition at line 176 of file ParentableObject.h.


Member Typedef Documentation

template<class ParentT >
typedef ParentableObject PLearn::TypedParentableObject< ParentT >::inherited [private]

Reimplemented from PLearn::ParentableObject.

Definition at line 178 of file ParentableObject.h.


Constructor & Destructor Documentation

template<class T >
PLearn::TypedParentableObject< T >::TypedParentableObject ( bool  adoptive_parent = false,
ParentKind  pk = WeakParent 
)

Default constructor.

Definition at line 224 of file ParentableObject.h.

    : inherited(adoptive_parent, pk)
{ }

Member Function Documentation

template<class ParentT >
string PLearn::TypedParentableObject< ParentT >::_classname_ ( ) [static]

Reimplemented from PLearn::ParentableObject.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
OptionList & PLearn::TypedParentableObject< ParentT >::_getOptionList_ ( ) [static]

Reimplemented from PLearn::ParentableObject.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
RemoteMethodMap & PLearn::TypedParentableObject< ParentT >::_getRemoteMethodMap_ ( ) [static]

Reimplemented from PLearn::ParentableObject.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
bool PLearn::TypedParentableObject< ParentT >::_isa_ ( const Object o) [static]

Reimplemented from PLearn::ParentableObject.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
Object * PLearn::TypedParentableObject< ParentT >::_new_instance_for_typemap_ ( ) [static]

Reimplemented from PLearn::Object.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
void PLearn::TypedParentableObject< ParentT >::_static_initialize_ ( ) [static]

Reimplemented from PLearn::ParentableObject.

Definition at line 221 of file ParentableObject.h.

template<class T >
void PLearn::TypedParentableObject< T >::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::ParentableObject.

Definition at line 229 of file ParentableObject.h.

References PLearn::ParentableObject::build(), and PLearn::TypedParentableObject< ParentT >::build_().

Here is the call graph for this function:

template<class T >
void PLearn::TypedParentableObject< T >::build_ ( ) [private]

This does the actual building.

Reimplemented from PLearn::ParentableObject.

Definition at line 236 of file ParentableObject.h.

References PLearn::TypedParentableObject< ParentT >::checkParent(), and PLearn::ParentableObject::m_parent.

Referenced by PLearn::TypedParentableObject< ParentT >::build().

{
    // We simply dynamically check that the parent, if any, makes sense
    if (m_parent)
        checkParent();
}

Here is the call graph for this function:

Here is the caller graph for this function:

template<class T >
void PLearn::TypedParentableObject< T >::checkParent ( ) const [virtual]

Override to ensure that the assumed parent type is satisfied.

Reimplemented from PLearn::ParentableObject.

Definition at line 244 of file ParentableObject.h.

References PLearn::Object::classname(), PLearn::ParentableObject::m_parent, PLASSERT, and PLERROR.

Referenced by PLearn::TypedParentableObject< ParentT >::build_().

{
    // We simply dynamically check that the parent, makes sense
    PLASSERT( m_parent );
    if (! dynamic_cast<T*>(m_parent))
        PLERROR("TypedParentableObject::checkParent: Expected a parent of type %s\n"
                "but got one of type %s", T::_classname_().c_str(),
                m_parent->classname().c_str());
}

Here is the call graph for this function:

Here is the caller graph for this function:

template<class ParentT >
string PLearn::TypedParentableObject< ParentT >::classname ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
static const PPath& PLearn::TypedParentableObject< ParentT >::declaringFile ( ) [inline, static]

Reimplemented from PLearn::ParentableObject.

Definition at line 202 of file ParentableObject.h.

: 
template<class ParentT >
TypedParentableObject< ParentT > * PLearn::TypedParentableObject< ParentT >::deepCopy ( CopiesMap copies) const [virtual]

Reimplemented from PLearn::ParentableObject.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
OptionList & PLearn::TypedParentableObject< ParentT >::getOptionList ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
OptionMap & PLearn::TypedParentableObject< ParentT >::getOptionMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
RemoteMethodMap & PLearn::TypedParentableObject< ParentT >::getRemoteMethodMap ( ) const [virtual]

Reimplemented from PLearn::Object.

Definition at line 221 of file ParentableObject.h.

template<class ParentT >
const ParentT* PLearn::TypedParentableObject< ParentT >::parent ( ) const [inline]

Reimplemented from PLearn::ParentableObject.

Definition at line 190 of file ParentableObject.h.

References PLearn::ParentableObject::m_parent.

    {
        return static_cast<const ParentT*>(m_parent);
    }
template<class ParentT >
ParentT* PLearn::TypedParentableObject< ParentT >::parent ( ) [inline]

Typed version of parent accessor (hides the inherited one; this is OK)

Reimplemented from PLearn::ParentableObject.

Definition at line 185 of file ParentableObject.h.

References PLearn::ParentableObject::m_parent.

    {
        return static_cast<ParentT*>(m_parent);
    }

Member Data Documentation

template<class ParentT >
StaticInitializer PLearn::TypedParentableObject< ParentT >::_static_initializer_ [static]

Reimplemented from PLearn::ParentableObject.

Definition at line 202 of file ParentableObject.h.


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