1 // NodeHandleMap.h 2 3 #ifndef NET_FS_NODE_HANDLE_MAP_H 4 #define NET_FS_NODE_HANDLE_MAP_H 5 6 #include <HashMap.h> 7 8 #include "Locker.h" 9 #include "NodeHandle.h" 10 11 12 // NodeHandleMap 13 class NodeHandleMap : HashMap<HashKey32<int32>, NodeHandle*>, Locker { 14 public: 15 NodeHandleMap(const char* name); 16 ~NodeHandleMap(); 17 18 status_t Init(); 19 20 status_t AddNodeHandle(NodeHandle* handle); 21 bool RemoveNodeHandle(NodeHandle* handle); 22 23 status_t LockNodeHandle(int32 cookie, 24 NodeHandle** _handle); 25 void UnlockNodeHandle(NodeHandle* handle); 26 27 private: 28 int32 _NextNodeHandleCookie(); 29 vint32 fNextNodeHandleCookie; 30 }; 31 32 33 #endif // NET_FS_NODE_HANDLE_MAP_H 34