PLearn 0.1
Public Member Functions | Public Attributes
PLearn::Parent Class Reference
Inheritance diagram for PLearn::Parent:
Inheritance graph
[legend]
Collaboration diagram for PLearn::Parent:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Parent (int ipp=0, string spp="parent")
void print (ostream &out)
 Parent (const Parent &other)
ParentdeepCopy (CopiesMap &copies) const

Public Attributes

int i_par
 integer in the hundreds
string s_par
 string representing number in the hundreds
PP< ChildAchildAPP
PP< ChildBchildBPP

Detailed Description

Definition at line 157 of file PPTest.cc.


Constructor & Destructor Documentation

PLearn::Parent::Parent ( int  ipp = 0,
string  spp = "parent" 
) [inline]

Definition at line 166 of file PPTest.cc.

: i_par(ipp), s_par(spp) {}
PLearn::Parent::Parent ( const Parent other) [inline]

Definition at line 169 of file PPTest.cc.

                              : i_par(other.i_par), s_par(other.s_par), 
        childAPP(other.childAPP), childBPP(other.childBPP){}

Member Function Documentation

Parent* PLearn::Parent::deepCopy ( CopiesMap copies) const [inline]

< a copy already exists, so return it

Otherwise call the copy constructor to obtain a copy

Put the copy in the map

Reimplemented in PLearn::ChildA, and PLearn::ChildB.

Definition at line 172 of file PPTest.cc.

References childAPP, childBPP, PLearn::deepCopy(), and PLearn::usage().

  {
    CopiesMap::iterator it = copies.find(this);
    if(it!=copies.end())  
      return (Parent*) it->second;
        
    Parent* dcopy = new Parent(*this);
    dcopy->childAPP = PLearn::deepCopy( childAPP );
    dcopy->childBPP = PLearn::deepCopy( childBPP );
        
    if (usage() > 1)
      copies[this] = dcopy;
        
    return dcopy;
  }     

Here is the call graph for this function:

void PLearn::Parent::print ( ostream &  out) [inline]

Reimplemented in PLearn::ChildA, and PLearn::ChildB.

Definition at line 167 of file PPTest.cc.

References PLearn::endl().

{ out << "* Parent:\ti_par= " << i_par << "\ts_par= " << s_par << endl; }

Here is the call graph for this function:


Member Data Documentation

Reimplemented in PLearn::ChildB.

Definition at line 164 of file PPTest.cc.

Referenced by deepCopy().

Reimplemented in PLearn::ChildA.

Definition at line 165 of file PPTest.cc.

Referenced by deepCopy().


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