1 module dsymbol.cache_entry; 2 3 import dsymbol.symbol; 4 import std.datetime; 5 import containers.openhashset; 6 import containers.unrolledlist; 7 8 /** 9 * Module cache entry 10 */ 11 struct CacheEntry 12 { 13 /// Module root symbol 14 DSymbol* symbol; 15 16 /// Modification time when this file was last cached 17 SysTime modificationTime; 18 19 /// The path to the module 20 istring path; 21 22 /// The modules that this module depends on 23 OpenHashSet!istring dependencies; 24 25 ~this() 26 { 27 if (symbol !is null) 28 typeid(DSymbol).destroy(symbol); 29 } 30 31 int opCmp(ref const CacheEntry other) const pure nothrow @nogc @safe 32 { 33 immutable int r = path > other.path; 34 if (path < other.path) 35 return -1; 36 return r; 37 } 38 39 bool opEquals(ref const CacheEntry other) const pure nothrow @nogc @safe 40 { 41 return path == other.path; 42 } 43 44 size_t toHash() const nothrow @safe 45 { 46 return path.toHash(); 47 } 48 49 @disable void opAssign(ref const CacheEntry other); 50 }