changed map and list templates to be more useable, however, they will
be rewritten soon. Changed debugging macros and use of them, too. Also replaced the linked lists in the BufferManager (which were complicated, but working ok) with template based ones. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2133 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,6 +6,16 @@ template<class key, class value> class Map
|
||||
public:
|
||||
Map() : count(0) {}
|
||||
|
||||
Map(const Map<key, value> &other)
|
||||
{
|
||||
printf("template<class key, class value> class Map copy constructor\n");
|
||||
count = other.count;
|
||||
for (int i = 0; i < count; i++) {
|
||||
list[i].v = other.list[i].v;
|
||||
list[i].k = other.list[i].k;
|
||||
}
|
||||
}
|
||||
|
||||
bool Insert(const key &k, const value &v)
|
||||
{
|
||||
value temp;
|
||||
@@ -70,6 +80,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsEmpty()
|
||||
{
|
||||
return count == 0;
|
||||
}
|
||||
|
||||
private:
|
||||
enum { MAXENT = 64 };
|
||||
struct ent {
|
||||
|
||||
Reference in New Issue
Block a user