NeKernel dev
Loading...
Searching...
No Matches
NetworkDevice.inl
Go to the documentation of this file.
1/* ========================================
2
3 Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
4
5======================================== */
6
7/***
8 Dtor and ctors.
9*/
10
11#ifndef __INC_NETWORK_DEVICE_H__
13#endif // __INC_NETWORK_DEVICE_H__
14
15namespace Kernel {
16inline NetworkDevice::NetworkDevice(void (*out)(DeviceInterface<NetworkDeviceCommand>*,
20 void (*on_cleanup)(void))
21 : DeviceInterface<NetworkDeviceCommand>(out, in), fCleanup(on_cleanup) {
22 kout << "NetworkDevice initialized.\r";
23
24 MUST_PASS(out && in && on_cleanup);
25}
26
27inline NetworkDevice::~NetworkDevice() {
28 kout << "NetworkDevice cleanup.\r";
29
30 if (fCleanup) fCleanup();
31}
32} // namespace Kernel
#define kout
Definition DebugOutput.h:189
#define MUST_PASS(EXPR)
Definition KernelPanic.h:37
Device contract interface, represents an HW device.
Definition DeviceMgr.h:42
UPS inline definitions.
Definition Device.h:12
Definition NetworkDevice.h:42