home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-05-24 | 706 b | 45 lines | [TEXT/CWIE] |
- //Copyright (c) 1997 Aidan Cully
- //All rights reserved
-
- #ifndef __CLEANUP_H
- #define __CLEANUP_H
-
- #include <Types.h>
- #include "CLQueue.h"
-
- typedef Boolean (*CleanupProc)( UInt32, void* );
-
- enum {
- kSuccess = 0,
- kDuplicateActionErr = 1,
- kActionNotFoundErr = 2,
- kActionLocalErr = 3,
- kCleanupMemErr = 255
- };
-
- class TCleanup
- {
- protected:
- class TProcEl
- {
- public:
- UInt32 mProcID;
- CleanupProc mProc;
- };
- class TDataEl
- {
- public:
- UInt32 mProcID;
- void *mData;
- };
- TQueue<TDataEl*> mQueue;
- TList<TProcEl*> mProcs;
- public:
- virtual ~TCleanup();
- UInt8 RegisterDirtyAction( UInt32, CleanupProc );
- UInt8 UnregisterDirtyAction( UInt32 );
- UInt8 NotifyDirty( UInt32, void* );
- UInt8 Clean();
- };
-
- #endif