diff options
| -rw-r--r-- | doc/requirements/BufferedStream.md | 19 | ||||
| -rw-r--r-- | doc/requirements/UnbufferedStream.md | 19 | ||||
| -rw-r--r-- | src/kernel/NeKit/Stream.h | 10 |
3 files changed, 47 insertions, 1 deletions
diff --git a/doc/requirements/BufferedStream.md b/doc/requirements/BufferedStream.md new file mode 100644 index 00000000..1ac01a0f --- /dev/null +++ b/doc/requirements/BufferedStream.md @@ -0,0 +1,19 @@ +# BufferedStream + +## Abstract: + +One type that has to satisfy a BufferedStream operator and type. + +## Rationale: + +- HPC systems. +- I/O systems. +- HFT systems. + +## Example: + +```cpp +BStream<BOperator, BType>; +``` + +BOperator must not flush at all times, but have the option to. diff --git a/doc/requirements/UnbufferedStream.md b/doc/requirements/UnbufferedStream.md new file mode 100644 index 00000000..80536b44 --- /dev/null +++ b/doc/requirements/UnbufferedStream.md @@ -0,0 +1,19 @@ +# BufferedStream + +## Abstract: + +One type that has to satisfy an unbuffered Stream operator and type. + +## Rationale: + +- Fast and direct-flush operations. +- High-Throughput systems. + +## Example: + +```cpp +UBStream<UBOperator, UBType>; +``` + +UBOperator must flush at all times! + diff --git a/src/kernel/NeKit/Stream.h b/src/kernel/NeKit/Stream.h index d69df6d0..b24038c1 100644 --- a/src/kernel/NeKit/Stream.h +++ b/src/kernel/NeKit/Stream.h @@ -1,4 +1,4 @@ -// Copyright 2024-2025, Amlal El Mahrouss (amlal@nekernel.org) +// Copyright 2024-2026, Amlal El Mahrouss (amlal@nekernel.org) // Licensed under the Apache License, Version 2.0 (see LICENSE file) // Official repository: https://github.com/ne-foss-org/nekernel @@ -9,6 +9,7 @@ #include <NeKit/Ref.h> namespace Kernel { + template <typename StreamTrait, typename Kind> class Stream final { public: @@ -40,6 +41,13 @@ class Stream final { Ref<StreamTrait> fStream; Ref<Kind> fKind; }; + +template <class ST, class Kind> +using UnbufferedStream = Stream<ST, Kind>; + +template <class BST, class BKind> +using BufferedStream = Stream<BST, BKind>; + } // namespace Kernel #endif |
