summaryrefslogtreecommitdiffhomepage
path: root/Kernel/KernelKit/PCI/Iterator.hpp
blob: 278711a7476432b535cc915d3caf147a7bb1ce99 (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
33
34
35
36
37
38
#ifndef __PCI_ITERATOR_HPP__
#define __PCI_ITERATOR_HPP__

#include <KernelKit/PCI/Database.hpp>
#include <KernelKit/PCI/Device.hpp>
#include <NewKit/Array.hpp>
#include <NewKit/Defines.hpp>
#include <NewKit/Ref.hpp>

#define NEWOS_BUS_COUNT		 (256)
#define NEWOS_DEVICE_COUNT	 (33)
#define NEWOS_FUNCTION_COUNT (8)

namespace NewOS::PCI
{
	class Iterator final
	{
	public:
		Iterator() = delete;

	public:
		explicit Iterator(const Types::PciDeviceKind& deviceType);

		Iterator& operator=(const Iterator&) = default;

		Iterator(const Iterator&) = default;

		~Iterator();

	public:
		Ref<PCI::Device> operator[](const Size& sz);

	private:
		Array<PCI::Device, NEWOS_BUS_COUNT> fDevices;
	};
} // namespace NewOS::PCI

#endif // __PCI_ITERATOR_HPP__