//
//  Copyright © 2003, RESON Inc. All Rights Reserved.
//
//  No part of this file may be reproduced or transmitted in any form or by
//  any means, electronic or mechanical, including photocopy, recording, or
//  information storage or retrieval system, without permission in writing
//  from RESON Inc.
//
//  Filename:   Parent.h
//
//  Project:    6046
//
//  Author(s):  W. Arcus
//
//  Purpose:    
//
//  Notes:      
//

#if !defined(AFX_DISPATCHER_H__2DAD7484_A254_4035_8A12_6F506E91A3FD__INCLUDED_)
#define AFX_DISPATCHER_H__2DAD7484_A254_4035_8A12_6F506E91A3FD__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

template <class tParent>
class CParent
{
protected:

    tParent    *m_pParent;

public:

    CParent( tParent const * pParent = NULL )
    {
        m_pParent = const_cast<tParent *>( pParent );
    }

    CParent( const CParent &rRhs )
    {
        m_pParent = rRhs.m_pParent;
    }

    virtual ~CParent( void )
    {
        m_pParent = NULL;
    }

    CParent & operator = ( const CParent &rRhs )
    {
        m_pParent = rRhs.m_pParent;

        return *this;
    }

    void Parent( tParent * const pParent )
    {
        m_pParent = pParent;
        ASSERT( m_pParent != NULL );
    }

    tParent & Parent( void )
    {
        ASSERT( m_pParent != NULL );
        return (*m_pParent);
    }
};

#endif // !defined(AFX_DISPATCHER_H__2DAD7484_A254_4035_8A12_6F506E91A3FD__INCLUDED_)


