*/
class TypeInfo
{
- hash_t toHash()
+ override hash_t toHash()
{ hash_t hash;
foreach (char c; this.toString())
return hash;
}
- int opCmp(Object o)
+ override int opCmp(Object o)
{
if (this is o)
return 0;
return dstrcmp(this.toString(), ti.toString());
}
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
/* TypeInfo instances are singletons, but duplicates can exist
* across DLL's. Therefore, comparing for a name match is
class TypeInfo_Typedef : TypeInfo
{
- string toString() { return name; }
+ override string toString() { return name; }
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Typedef c;
return this is o ||
this.base == c.base);
}
- hash_t getHash(in void* p) { return base.getHash(p); }
- equals_t equals(in void* p1, in void* p2) { return base.equals(p1, p2); }
- int compare(in void* p1, in void* p2) { return base.compare(p1, p2); }
- size_t tsize() { return base.tsize(); }
- void swap(void* p1, void* p2) { return base.swap(p1, p2); }
+ override hash_t getHash(in void* p) { return base.getHash(p); }
+ override equals_t equals(in void* p1, in void* p2) { return base.equals(p1, p2); }
+ override int compare(in void* p1, in void* p2) { return base.compare(p1, p2); }
+ override size_t tsize() { return base.tsize(); }
+ override void swap(void* p1, void* p2) { return base.swap(p1, p2); }
- TypeInfo next() { return base.next(); }
- uint flags() { return base.flags(); }
- void[] init() { return m_init.length ? m_init : base.init(); }
+ override TypeInfo next() { return base.next(); }
+ override uint flags() { return base.flags(); }
+ override void[] init() { return m_init.length ? m_init : base.init(); }
TypeInfo base;
string name;
class TypeInfo_Pointer : TypeInfo
{
- string toString() { return m_next.toString() ~ "*"; }
+ override string toString() { return m_next.toString() ~ "*"; }
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Pointer c;
return this is o ||
this.m_next == c.m_next);
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
return cast(hash_t)*cast(void**)p;
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
return *cast(void**)p1 == *cast(void**)p2;
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
if (*cast(void**)p1 < *cast(void**)p2)
return -1;
return 0;
}
- size_t tsize()
+ override size_t tsize()
{
return (void*).sizeof;
}
- void swap(void* p1, void* p2)
+ override void swap(void* p1, void* p2)
{
void* tmp = *cast(void**)p1;
*cast(void**)p1 = *cast(void**)p2;
*cast(void**)p2 = tmp;
}
- TypeInfo next() { return m_next; }
- uint flags() { return 1; }
+ override TypeInfo next() { return m_next; }
+ override uint flags() { return 1; }
TypeInfo m_next;
}
class TypeInfo_Array : TypeInfo
{
- string toString() { return value.toString() ~ "[]"; }
+ override string toString() { return value.toString() ~ "[]"; }
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Array c;
return this is o ||
this.value == c.value);
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
size_t sz = value.tsize();
hash_t hash = 0;
return hash;
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
void[] a1 = *cast(void[]*)p1;
void[] a2 = *cast(void[]*)p2;
return true;
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
void[] a1 = *cast(void[]*)p1;
void[] a2 = *cast(void[]*)p2;
return cast(int)a1.length - cast(int)a2.length;
}
- size_t tsize()
+ override size_t tsize()
{
return (void[]).sizeof;
}
- void swap(void* p1, void* p2)
+ override void swap(void* p1, void* p2)
{
void[] tmp = *cast(void[]*)p1;
*cast(void[]*)p1 = *cast(void[]*)p2;
TypeInfo value;
- TypeInfo next()
+ override TypeInfo next()
{
return value;
}
- uint flags() { return 1; }
+ override uint flags() { return 1; }
}
class TypeInfo_StaticArray : TypeInfo
{
- string toString()
+ override string toString()
{
- char [10] tmp = void;
- return value.toString() ~ "[" ~ tmp.intToString(len) ~ "]";
+ char[10] tmp = void;
+ return cast(string)(value.toString() ~ "[" ~ tmp.intToString(len) ~ "]");
}
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_StaticArray c;
return this is o ||
this.value == c.value);
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
size_t sz = value.tsize();
hash_t hash = 0;
return hash;
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
size_t sz = value.tsize();
return true;
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
size_t sz = value.tsize();
return 0;
}
- size_t tsize()
+ override size_t tsize()
{
return len * value.tsize();
}
- void swap(void* p1, void* p2)
+ override void swap(void* p1, void* p2)
{
void* tmp;
size_t sz = value.tsize();
delete pbuffer;
}
- void[] init() { return value.init(); }
- TypeInfo next() { return value; }
- uint flags() { return value.flags(); }
+ override void[] init() { return value.init(); }
+ override TypeInfo next() { return value; }
+ override uint flags() { return value.flags(); }
TypeInfo value;
size_t len;
class TypeInfo_AssociativeArray : TypeInfo
{
- string toString()
+ override string toString()
{
- return next.toString() ~ "[" ~ key.toString() ~ "]";
+ return cast(string)(next.toString() ~ "[" ~ key.toString() ~ "]");
}
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_AssociativeArray c;
return this is o ||
// BUG: need to add the rest of the functions
- size_t tsize()
+ override size_t tsize()
{
return (char[int]).sizeof;
}
- TypeInfo next() { return value; }
- uint flags() { return 1; }
+ override TypeInfo next() { return value; }
+ override uint flags() { return 1; }
TypeInfo value;
TypeInfo key;
class TypeInfo_Function : TypeInfo
{
- string toString()
+ override string toString()
{
- return next.toString() ~ "()";
+ return cast(string)(next.toString() ~ "()");
}
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Function c;
return this is o ||
// BUG: need to add the rest of the functions
- size_t tsize()
+ override size_t tsize()
{
return 0; // no size for functions
}
class TypeInfo_Delegate : TypeInfo
{
- string toString()
+ override string toString()
{
- return next.toString() ~ " delegate()";
+ return cast(string)(next.toString() ~ " delegate()");
}
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Delegate c;
return this is o ||
// BUG: need to add the rest of the functions
- size_t tsize()
+ override size_t tsize()
{
alias int delegate() dg;
return dg.sizeof;
}
- uint flags() { return 1; }
+ override uint flags() { return 1; }
TypeInfo next;
}
class TypeInfo_Class : TypeInfo
{
- string toString() { return info.name; }
+ override string toString() { return info.name; }
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Class c;
return this is o ||
this.info.name == c.classinfo.name);
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
Object o = *cast(Object*)p;
return o ? o.toHash() : 0;
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
Object o1 = *cast(Object*)p1;
Object o2 = *cast(Object*)p2;
return (o1 is o2) || (o1 && o1.opEquals(o2));
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
Object o1 = *cast(Object*)p1;
Object o2 = *cast(Object*)p2;
return c;
}
- size_t tsize()
+ override size_t tsize()
{
return Object.sizeof;
}
- uint flags() { return 1; }
+ override uint flags() { return 1; }
- OffsetTypeInfo[] offTi()
+ override OffsetTypeInfo[] offTi()
{
return (info.flags & 4) ? info.offTi : null;
}
class TypeInfo_Interface : TypeInfo
{
- string toString() { return info.name; }
+ override string toString() { return info.name; }
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Interface c;
return this is o ||
this.info.name == c.classinfo.name);
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
Interface* pi = **cast(Interface ***)*cast(void**)p;
Object o = cast(Object)(*cast(void**)p - pi.offset);
return o.toHash();
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
Interface* pi = **cast(Interface ***)*cast(void**)p1;
Object o1 = cast(Object)(*cast(void**)p1 - pi.offset);
return o1 == o2 || (o1 && o1.opCmp(o2) == 0);
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
Interface* pi = **cast(Interface ***)*cast(void**)p1;
Object o1 = cast(Object)(*cast(void**)p1 - pi.offset);
return c;
}
- size_t tsize()
+ override size_t tsize()
{
return Object.sizeof;
}
- uint flags() { return 1; }
+ override uint flags() { return 1; }
ClassInfo info;
}
class TypeInfo_Struct : TypeInfo
{
- string toString() { return name; }
+ override string toString() { return name; }
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
TypeInfo_Struct s;
return this is o ||
this.init.length == s.init.length);
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
assert(p);
if (xtoHash)
}
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
if (p1 == p2)
return true;
return memcmp(p1, p2, init.length) == 0;
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
// Regard null references as always being "less than"
if (p1 != p2)
return 0;
}
- size_t tsize()
+ override size_t tsize()
{
return init.length;
}
- void[] init() { return m_init; }
+ override void[] init() { return m_init; }
- uint flags() { return m_flags; }
+ override uint flags() { return m_flags; }
string name;
void[] m_init; // initializer; init.ptr == null if 0 initialize
{
TypeInfo[] elements;
- string toString()
+ override string toString()
{
string s = "(";
foreach (i, element; elements)
return s;
}
- equals_t opEquals(Object o)
+ override equals_t opEquals(Object o)
{
if (this is o)
return true;
return false;
}
- hash_t getHash(in void* p)
+ override hash_t getHash(in void* p)
{
assert(0);
}
- equals_t equals(in void* p1, in void* p2)
+ override equals_t equals(in void* p1, in void* p2)
{
assert(0);
}
- int compare(in void* p1, in void* p2)
+ override int compare(in void* p1, in void* p2)
{
assert(0);
}
- size_t tsize()
+ override size_t tsize()
{
assert(0);
}
- void swap(void* p1, void* p2)
+ override void swap(void* p1, void* p2)
{
assert(0);
}
this.info = traceContext();
}
- string toString()
+ override string toString()
{
return msg;
}