Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

wefts_cleanup.h

Go to the documentation of this file.
00001 /*
00002    wefts_cleanup.h
00003    Cleanup interface.
00004 
00005    $Id: wefts_cleanup.h,v 1.3 2004/03/08 20:28:53 jonnymind Exp $
00006 ---------------------------------------------
00007    Begin      : 2003-08-14 23:45
00008    Author     : Giancarlo Niccolai
00009 
00010    Last modified because:
00011 
00012 */
00013 
00014 /**************************************************************************
00015 *   This program is free software; you can redistribute it and/or modify  *
00016 *   it under the terms of the GNU Library General Public License as       *
00017 *   published by the Free Software Foundation; either version 2.1 of the  *
00018 *   License, or (at your option) any later version.                       *
00019 ***************************************************************************/
00020 
00021 #ifndef WT_CLEANUP_H
00022 #define WT_CLEANUP_H
00023 #include <stack>
00024 
00025 namespace Wefts {
00026 
00033 class CleanupHandler
00034 {
00035 public:
00048    virtual void handleCleanup( int code, void *caller=0 )=0;
00049 };
00050 
00052 class CleanupItem
00053 {
00054 public:
00056    CleanupHandler *handler;
00058    int position;
00060    void *caller;
00061    
00063    CleanupItem() {}
00064    
00070    CleanupItem( CleanupHandler *h )
00071    {
00072       handler = h;
00073    }
00074    
00085    CleanupItem( CleanupHandler *h, int p )
00086    {
00087       handler = h;
00088       position = p;
00089    }
00090    
00097    CleanupItem( CleanupHandler *h, int p, void *c )
00098    {
00099       handler = h;
00100       position = p;
00101       caller = c;
00102    }
00103 }; 
00104 
00106 typedef std::stack< CleanupItem > CleanupList;
00107 
00108 }
00109 
00110 #endif
00111 /* end of wefts_cleanup.h */

Generated on Sat Mar 13 21:05:43 2004 for Wefts by doxygen 1.3.5