![]() |
The Simons
|
00001 00002 // 00003 // SCL : Simons Component Library 00004 // 00006 // 00007 // Filename: Map.h 00008 // Contents: Map class 00009 // Author: Anthony J H Simons 00010 // Revised: 22 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_MAP 00020 #define SCL_MAP 00021 00022 #include "Set.h" // Include my superclass type 00023 #include "MapID.h" // Include my pointer type 00024 00025 #include "BagID.h" // Depends on the pointer type 00026 00043 00044 class Map : public Set { 00045 protected: 00046 Map(const Map&); 00047 public: 00048 Map(); 00049 virtual ~Map(); 00050 Map(CollectionID); 00051 virtual ObjectID clone() const; 00052 virtual Void add(ObjectID); 00053 virtual Void remove(ObjectID); 00054 virtual Void retainAll(CollectionID); 00055 Void addAt(ObjectID, ObjectID); 00056 Void removeAt(ObjectID); 00057 ObjectID getAt(ObjectID) const; 00058 SetID domain() const; 00059 SetID range() const; 00060 ObjectID domain(Integer) const; 00061 ObjectID range(Integer) const; 00062 MapID compose(MapID) const; 00063 }; 00064 00066 00069 inline MapID::MapID() {} 00070 00072 inline MapID::~MapID() {} 00073 00077 inline MapID::MapID(const Null* null) : 00078 SetID(null) {} 00079 00083 inline MapID::MapID(const Map* map) : 00084 SetID(map) {} 00085 00089 inline MapID::MapID(const MapID& pointer) : 00090 SetID(pointer) {} 00091 00095 inline MapID& MapID::operator=(const Map* map) { 00096 assign(map); 00097 return *this; 00098 } 00099 00104 inline MapID& MapID::operator=(const MapID& pointer) { 00105 assign(pointer); 00106 return *this; 00107 } 00108 00109 00110 #endif 00111