00001 // Filename: weakPointerCallback.h 00002 // Created by: drose (06Oct06) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef WEAKPOINTERCALLBACK_H 00016 #define WEAKPOINTERCALLBACK_H 00017 00018 #include "pandabase.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Class : WeakPointerCallback 00022 // Description : Derive from this class and override the callback() 00023 // method if you want to get an immediate callback from 00024 // a WeakPointerTo object when its referenced pointer is 00025 // deleted. 00026 //////////////////////////////////////////////////////////////////// 00027 class EXPCL_PANDAEXPRESS WeakPointerCallback { 00028 public: 00029 virtual ~WeakPointerCallback(); 00030 virtual void wp_callback(void *pointer)=0; 00031 }; 00032 00033 #include "weakPointerCallback.I" 00034 00035 #endif