1// NodeRef.h 2 3#ifndef NET_FS_NODE_REF_H 4#define NET_FS_NODE_REF_H 5 6#include <Node.h> 7 8struct NodeRef : node_ref { 9 NodeRef() {} 10 11 NodeRef(const node_ref& ref) 12 : node_ref(ref) 13 { 14 } 15 16 NodeRef(dev_t volumeID, ino_t nodeID) 17 { 18 device = volumeID; 19 node = nodeID; 20 } 21 22 NodeRef(const NodeRef& other) 23 : node_ref(other) 24 { 25 } 26 27 uint32 GetHashCode() const 28 { 29 uint64 v = (uint64)node; 30 return (uint32)(v >> 32) ^ (uint32)v ^ (uint32)device; 31 } 32 33 NodeRef& operator=(const node_ref& other) 34 { 35 node_ref::operator=(other); 36 return *this; 37 } 38 39 bool operator==(const node_ref& other) const 40 { 41 return node_ref::operator==(other); 42 } 43 44 bool operator!=(const NodeRef& other) const 45 { 46 return !(*this == other); 47 } 48}; 49 50#endif // NET_FS_NODE_REF_H 51