summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/NetworkKit/NetworkDevice.inl
blob: a86d7e56cfd10961eaa3d95dbf4c69383887d909 (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, licensed under the Apache 2.0 license.

======================================== */

/***
  Dtor and ctors.
*/

#ifndef __INC_NETWORK_DEVICE_H__
#include <NetworkKit/NetworkDevice.h>
#endif  // __INC_NETWORK_DEVICE_H__

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

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

inline NetworkDevice::~NetworkDevice() {
  kout << "NetworkDevice cleanup.\r";

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