pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src plf_handle.hxx,NONE,1.1


From: grumbel
Subject: [Pingus-CVS] CVS: Games/Pingus/src plf_handle.hxx,NONE,1.1
Date: 3 Mar 2003 23:01:42 -0000

Update of /usr/local/cvsroot/Games/Pingus/src
In directory dark:/tmp/cvs-serv8131

Added Files:
        plf_handle.hxx 
Log Message:
missing file


--- NEW FILE: plf_handle.hxx ---
//  $Id: plf_handle.hxx,v 1.1 2003/03/03 23:01:40 grumbel Exp $
// 
//  Pingus - A free Lemmings clone
//  Copyright (C) 2002 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
// 
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_PLF_HANDLE_HXX
#define HEADER_PINGUS_PLF_HANDLE_HXX

#include <assert.h>

class PLF;

/** Little PLF wrapper class to avoid possible deletion of our PLF* */
class PLFHandle
{
private:
  PLF* plf;

public:
  PLFHandle() : plf(0) {}
  PLFHandle (PLF* p) : plf (p) {}
  PLFHandle (const PLFHandle& p) : plf (p.plf) {}

  PLF* operator->() { assert(plf); return plf; }
  PLF* operator*() { assert(plf);  return plf; }
  
  PLFHandle& operator=(const PLFHandle& p) 
  { 
    plf = p.plf; 
    return *this; 
  } 
};

#endif

/* EOF */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]