/* ------------------------------------------- Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved. ------------------------------------------- */ #pragma once #include #include #include #include namespace NeOS { template class IOArray final { public: IOArray() = delete; IOArray(nullPtr) = delete; explicit IOArray(Array& ports) : fPorts(ports) { } ~IOArray() { } IOArray& operator=(const IOArray&) = default; IOArray(const IOArray&) = default; operator bool() { return !fPorts.Empty(); } public: template T In(SizeT index); template void Out(SizeT index, T value); private: Array fPorts; }; inline constexpr UInt16 kMaxPorts = 16; using IOArray16 = IOArray; template inline Array make_ports(UShort base) { Array ports; for (UShort i = 0; i < Sz; ++i) { ports[i] = base + i; } return ports; } } // namespace NeOS #ifdef __x86_64__ #include #else #error Please provide platform specific code for the I/O #endif // ifdef __x86_64__