Instance.h 893 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef HEADER_Instance
  2. #define HEADER_Instance
  3. /*
  4. htop - Instance.h
  5. (C) 2022-2023 htop dev team
  6. (C) 2022-2023 Sohaib Mohammed
  7. Released under the GNU GPLv2+, see the COPYING file
  8. in the source distribution for its full text.
  9. */
  10. #include "Hashtable.h"
  11. #include "Object.h"
  12. #include "Platform.h"
  13. #include "Row.h"
  14. typedef struct Instance_ {
  15. Row super;
  16. char* name; /* external instance name */
  17. const struct InDomTable_* indom; /* instance domain */
  18. /* default result offset to use for searching metrics with instances */
  19. unsigned int offset;
  20. } Instance;
  21. #define InDom_getId(i_) ((i_)->indom->id)
  22. #define Instance_getId(i_) ((i_)->super.id)
  23. #define Instance_setId(i_, id_) ((i_)->super.id = (id_))
  24. extern const RowClass Instance_class;
  25. Instance* Instance_new(const Machine* host, const struct InDomTable_* indom);
  26. void Instance_done(Instance* this);
  27. #endif