libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
creds.hxx
1#pragma once
2
3// cosmos
4#include <cosmos/types.hxx>
5
6// clues
7#include <clues/SystemCallItem.hxx>
8
9namespace clues::item {
10
11class CLUES_API UserID :
12 public SystemCallItem {
13public: // functions
14
15 explicit UserID(const ItemType type = ItemType::RETVAL,
16 const std::string_view short_name = "uid",
17 const std::string_view long_name = "user id") :
18 SystemCallItem{type, short_name, long_name} {
19 }
20
21 auto uid() const {
22 return m_uid;
23 }
24
25protected: // functions
26
27 void processValue(const Tracee &) override {
29 }
30
31protected: // data
32
33 cosmos::UserID m_uid = cosmos::UserID::INVALID;
34};
35
36class CLUES_API GroupID :
37 public SystemCallItem {
38public: // functions
39
40 explicit GroupID(const ItemType type = ItemType::RETVAL,
41 const std::string_view short_name = "gid",
42 const std::string_view long_name = "group id") :
43 SystemCallItem{type, short_name, long_name} {
44 }
45
46 auto gid() const {
47 return m_gid;
48 }
49
50protected: // functions
51
52 void processValue(const Tracee &) override {
54 }
55
56protected: // data
57
58 cosmos::GroupID m_gid = cosmos::GroupID::INVALID;
59};
60
61} // end ns
OTHER valueAs() const
Helper to cast the strongly typed Word m_val to other strong enum types.
SystemCallItem(const ItemType type, const std::string_view short_name={}, const std::string_view long_name={})
Constructs a new SystemCallItem.
Base class for traced processes.
Definition Tracee.hxx:39
void processValue(const Tracee &) override
Processes the value stored in m_val acc. to the actual item type.
Definition creds.hxx:52
void processValue(const Tracee &) override
Processes the value stored in m_val acc. to the actual item type.
Definition creds.hxx:27
ItemType
Basic type of a SystemCallItem.
@ RETVAL
A system call return value.