KeyID.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _SUPPORT_KEYID_H
00014 #define _SUPPORT_KEYID_H
00015 
00022 // XXX This is old code from PalmOS, it should be removed.
00023 // (We would like the same kind of functionality with file descriptors, though...)
00024 
00025 #include <support/Atom.h>
00026 
00027 typedef uint32_t KeyID;
00028 
00029 BNS(namespace palmos {)
00030 BNS(namespace support {)
00031 
00032 
00036 
00037 class SKeyID : virtual public SAtom {
00038 public:
00039 
00040     class FreeKey {
00041         public:
00042                     FreeKey();
00043             virtual ~FreeKey();
00044             virtual status_t    operator()(KeyID key) = 0;
00045     };
00046                     SKeyID(KeyID id, FreeKey* cleanup);
00047     KeyID           AsKeyID();
00048 protected:
00049     virtual         ~SKeyID();
00050 
00051 private:
00052                     SKeyID(const SKeyID&);
00053     KeyID           m_key;
00054     FreeKey         *m_cleanup;
00055 };
00056 
00059 BNS(} })
00060 
00061 #endif