Example #1
0
/**
 * Returns true if 'from' is (not necessarily directly) extending 'to'.
 */
int vf_is_extending(Class_Handle from, Class_Handle to) {
    while (from) {
        if( from == to ) return true;
        from = class_get_super_class(from);
    }
    return false;
}
Example #2
0
bool Target_Exception_Handler::is_assignable(Class_Handle exn_class)
{
    if (!_exc)
        return true;
    Class_Handle e = exn_class;
    while (e)
        if (e == _exc)
            return true;
        else
            e = class_get_super_class(e);
    return false;
}   //Target_Exception_Handler::is_assignable
Example #3
0
static int
isKindOf (id value, Class target)
{
  Class c;

  /* NULL target is catch-all.  */
  if (target == 0)
    return 1;

  for (c = value->class_pointer; c; c = class_get_super_class (c))
    if (c == target)
      return 1;
  return 0;
}