![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: Entry.h 00008 // Contents: Entry class 00009 // Author: Anthony J H Simons 00010 // Revised: 7 November 2005 00011 00012 // This software is distributed free in the hope that others will 00013 // find it useful. However, it comes WITHOUT ANY WARRANTY. No 00014 // liability can be accepted for software failure, merchantability 00015 // or fitness for a particular purpose. You can redistribute this 00016 // software in its original form, or in a modified form, provided 00017 // that this disclaimer is retained in the file banner. 00018 00019 #ifndef SCL_ENTRY 00020 #define SCL_ENTRY 00021 00022 #include "Object.h" // Include my superclass type 00023 #include "EntryID.h" // Include my pointer type 00024 00025 #include "ReaderID.h" // Depend on the pointer types 00026 #include "WriterID.h" 00027 00035 00036 class Entry : public Object { 00037 private: 00038 ObjectID domainKey; 00039 ObjectID rangeValue; 00040 Entry(const Entry&); 00041 public: 00042 Entry(); 00043 virtual ~Entry(); 00044 Entry(ObjectID, ObjectID); 00045 virtual ObjectID clone() const; 00046 virtual Natural hash() const; 00047 virtual Order compare(ObjectID) const; 00048 Order compare(EntryID) const; 00049 Order deepCompare(EntryID) const; 00050 virtual Void readOn(ReaderID); 00051 virtual Void writeOn(WriterID) const; 00052 ObjectID domain() const; 00053 ObjectID range() const; 00054 }; 00055 00057 00063 inline Natural Entry::hash() const { 00064 return domainKey->hash(); 00065 } 00066 00069 inline ObjectID Entry::domain() const { return domainKey; } 00070 00071 00074 inline ObjectID Entry::range() const { return rangeValue; } 00075 00077 00080 inline EntryID::EntryID() {} 00081 00083 inline EntryID::~EntryID() {} 00084 00088 inline EntryID::EntryID(const Null* null) : 00089 ObjectID(null) {} 00090 00094 inline EntryID::EntryID(const Entry* entry) : 00095 ObjectID(entry) {} 00096 00100 inline EntryID::EntryID(const EntryID& pointer) : 00101 ObjectID(pointer) {} 00102 00106 inline EntryID& EntryID::operator=(const Entry* entry) { 00107 assign(entry); 00108 return *this; 00109 } 00110 00115 inline EntryID& EntryID::operator=(const EntryID& pointer) { 00116 assign(pointer); 00117 return *this; 00118 } 00119 00120 00121 #endif