summaryrefslogtreecommitdiffhomepage
path: root/Kernel/CFKit/Property.hpp
blob: 519f486ef08f4d8efcf922ae0c6d5e00dce1780e (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
/* -------------------------------------------

	Copyright ZKA Technologies

------------------------------------------- */

#ifndef __INC_PROPS_HPP__
#define __INC_PROPS_HPP__

#include <NewKit/Array.hpp>
#include <NewKit/Defines.hpp>
#include <NewKit/Function.hpp>
#include <NewKit/String.hpp>

#define cMaxPropLen 4096

namespace Kernel
{
	/// @brief handle to anything (number, ptr, string...)
	using PropertyId = UIntPtr;

	/// @brief Kernel property class.
	/// @example \Properties\SmpCores or \Properties\KernelVersion
	class Property
	{
	public:
	    Property() = default;
		virtual ~Property();

	public:
		Property& operator=(const Property&) = default;
		Property(const Property&)			 = default;

		bool		StringEquals(StringView& name);
		PropertyId& GetValue();
		StringView& GetKey();

	private:
		StringView      fName{cMaxPropLen};
		PropertyId		fAction{No};
	};

	template <SizeT N>
	using PropertyArray = Array<Property, N>;
} // namespace Kernel

#endif // !__INC_PROPS_HPP__