RID.hpp 637 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef RID_H
  2. #define RID_H
  3. #include <gdnative/rid.h>
  4. namespace godot {
  5. class Object;
  6. class RID {
  7. godot_rid _godot_rid;
  8. public:
  9. RID();
  10. RID(Object *p);
  11. godot_rid _get_godot_rid() const;
  12. int32_t get_id() const;
  13. inline bool is_valid() const {
  14. // is_valid() is not available in the C API...
  15. return *this != RID();
  16. }
  17. bool operator==(const RID &p_other) const;
  18. bool operator!=(const RID &p_other) const;
  19. bool operator<(const RID &p_other) const;
  20. bool operator>(const RID &p_other) const;
  21. bool operator<=(const RID &p_other) const;
  22. bool operator>=(const RID &p_other) const;
  23. };
  24. } // namespace godot
  25. #endif // RID_H