blob: c7eb6d9821c1c70a4f352ffabcd0c91eb8f23a50 (
plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
|
// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org)
// Licensed under the Apache License, Version 2.0 (see LICENSE file)
// Official repository: https://github.com/nekernel-org/nekernel
#ifndef CFKIT_PROPS_H
#define CFKIT_PROPS_H
#include <CFKit/GUIDWrapper.h>
#include <NeKit/Array.h>
#include <NeKit/Config.h>
#include <NeKit/Function.h>
#include <NeKit/KString.h>
#define kMaxPropLen (256U)
namespace Kernel::CF {
/// @brief handle to anything (number, ptr, string...)
using PropertyId = UIntPtr;
/// @brief Kernel property class.
/// @note /prop/smp_max or /prop/kern_ver are properties.
class Property {
public:
Property();
virtual ~Property();
public:
Property& operator=(const Property&) = default;
Property(const Property&) = default;
BOOL StringEquals(KBasicString<>& name);
PropertyId& GetValue();
KBasicString<>& GetKey();
private:
KString fName{kMaxPropLen};
PropertyId fValue{0UL};
Ref<XRN::GUID> fGUID{};
};
template <SizeT N>
using PropertyArray = Array<Property, N>;
} // namespace Kernel::CF
namespace Kernel {
using namespace Kernel::CF;
}
#endif // !CFKIT_PROPS_H
|