summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/NetworkKit/NetworkDevice.inl
blob: dceae66e5b7486e6055fd1a6584a99e7fe9958e2 (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
/* -------------------------------------------

	Copyright (C) 2024-2025, Amlal EL Mahrouss, all rights reserved.

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

/***
	Dtor and ctors.
*/

namespace NeOS
{
	NetworkDevice::NetworkDevice(void (*out)(IDeviceObject<NetworkDeviceCommand>*, NetworkDeviceCommand),
								 void (*in)(IDeviceObject<NetworkDeviceCommand>*, NetworkDeviceCommand),
								 void (*on_cleanup)(void))
		: IDeviceObject<NetworkDeviceCommand>(out, in), fCleanup(on_cleanup)
	{
		kout << "NetworkDevice initialized.\r";

		MUST_PASS(out && in && on_cleanup);
	}

	NetworkDevice::~NetworkDevice()
	{
		MUST_PASS(fCleanup);

		kout << "NetworkDevice cleanup.\r";

		if (fCleanup)
			fCleanup();
	}
} // namespace NeOS