Object.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Interface for the Object class for Objective-C.
  2. Copyright (C) 1993-2019 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the
  6. Free Software Foundation; either version 3, or (at your option) any
  7. later version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT
  9. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  11. License for more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. #ifndef __object_INCLUDE_GNU
  20. #define __object_INCLUDE_GNU
  21. #include "objc.h"
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* The Object class is a very minimal root class included with the
  26. runtime. It is used as superclass for the two classes included
  27. with the runtime, Protocol and NXConstantString.
  28. Because Objective-C allows multiple root classes, you can define
  29. your own root class, different from Object.
  30. In particular, a Foundation library (such as GNUstep Base) is
  31. expected to provide its own root class (typically called NSObject),
  32. fully integrated with the library's own high-level features. It is
  33. expected that you should always use and interact with NSObject, and
  34. mostly ignore Object. */
  35. /* All classes are derived from Object. As such, this is the overhead
  36. tacked onto those objects. */
  37. @interface Object
  38. {
  39. Class isa; /* A pointer to the instance's class structure. */
  40. }
  41. - (Class)class;
  42. - (BOOL)isEqual: (id)anObject;
  43. @end
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif