aboutsummaryrefslogtreecommitdiffstats
path: root/pcp/Instance.h
blob: aefd642669058df82384ef6f3db6aaa3e168b4b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef HEADER_Instance
#define HEADER_Instance
/*
htop - Instance.h
(C) 2022-2023 htop dev team
(C) 2022-2023 Sohaib Mohammed
Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/

#include "Hashtable.h"
#include "Object.h"
#include "Platform.h"
#include "Row.h"


typedef struct Instance_ {
   Row super;

   char* name; /* external instance name */
   const struct InDomTable_* indom;  /* instance domain */

   /* default result offset to use for searching metrics with instances */
   unsigned int offset;
} Instance;

#define InDom_getId(i_)          ((i_)->indom->id)
#define Instance_getId(i_)       ((i_)->super.id)
#define Instance_setId(i_, id_)  ((i_)->super.id = (id_))

extern const RowClass Instance_class;

Instance* Instance_new(const Machine* host, const struct InDomTable_* indom);

void Instance_done(Instance* this);

#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy