1/* 2 * Copyright 2014, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef NODE_REF_H 6#define NODE_REF_H 7 8 9#include <Node.h> 10 11 12inline 13node_ref::node_ref() 14 : 15 device(-1), 16 node(-1) 17{ 18} 19 20 21inline 22node_ref::node_ref(dev_t device, ino_t node) 23 : 24 device(device), 25 node(node) 26{ 27} 28 29 30inline 31node_ref::node_ref(const node_ref& other) 32 : 33 device(other.device), 34 node(other.node) 35{ 36} 37 38 39inline bool 40node_ref::operator==(const node_ref& other) const 41{ 42 return device == other.device && node == other.node; 43} 44 45 46inline bool 47node_ref::operator!=(const node_ref& other) const 48{ 49 return !(*this == other); 50} 51 52 53inline bool 54node_ref::operator<(const node_ref& other) const 55{ 56 if (device != other.device) 57 return device < other.device; 58 return node < other.node; 59} 60 61 62inline node_ref& 63node_ref::operator=(const node_ref& other) 64{ 65 device = other.device; 66 node = other.node; 67 return *this; 68} 69 70 71#endif // NODE_REF_H 72