From 610f91d87152cbe48d3054fcf437d8239da6ef35 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 21 Dec 2024 21:59:13 +0100 Subject: IMP: :boom: Breaking changes some checks are needed to be done. Signed-off-by: Amlal --- dev/Kernel/CFKit/Property.h | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 dev/Kernel/CFKit/Property.h (limited to 'dev/Kernel/CFKit/Property.h') diff --git a/dev/Kernel/CFKit/Property.h b/dev/Kernel/CFKit/Property.h new file mode 100644 index 00000000..b7b22536 --- /dev/null +++ b/dev/Kernel/CFKit/Property.h @@ -0,0 +1,54 @@ +/* ------------------------------------------- + + Copyright (C) 2024, TQ B.V, all rights reserved. + +------------------------------------------- */ + +#ifndef CFKIT_PROPS_H +#define CFKIT_PROPS_H + +#include +#include +#include +#include + +#define kMaxPropLen 255 + +namespace CFKit +{ + using 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(); + virtual ~Property(); + + public: + Property& operator=(const Property&) = default; + Property(const Property&) = default; + + bool StringEquals(KString& name); + PropertyId& GetValue(); + KString& GetKey(); + + private: + KString fName{kMaxPropLen}; + PropertyId fValue{0UL}; + }; + + template + using PropertyArray = Array; +} // namespace CFKit + +namespace Kernel +{ + using namespace CFKit; +} + +#endif // !CFKIT_PROPS_H -- cgit v1.2.3