Lugdunum  0.1.0
QueueFamily.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <unordered_map>
4 #include <vector>
5 
8 
9 namespace lug {
10 namespace Graphics {
11 namespace Vulkan {
12 namespace API {
13 
14 namespace Builder {
15 class Device;
16 } // Builder
17 
19  friend class Builder::Device;
20 
21 public:
22  QueueFamily() = default;
23 
24  QueueFamily(const QueueFamily&) = delete;
25  QueueFamily(QueueFamily&& queueFamily);
26 
27  QueueFamily& operator=(const QueueFamily&) = delete;
28  QueueFamily& operator=(QueueFamily&& queueFamily);
29 
30  ~QueueFamily() = default;
31 
32  explicit operator uint32_t() const {
33  return _idx;
34  }
35 
36  uint32_t getIdx() const;
37  VkQueueFlags getFlags() const;
38 
39  const std::vector<Queue>& getQueues() const;
40  const Queue* getQueue(const std::string& queueName) const;
41 
42  bool supportsPresentation() const;
43  void supportsPresentation(bool presentation);
44 
45 private:
46  explicit QueueFamily(uint32_t idx, VkQueueFlags flags);
47 
48 private:
49  uint32_t _idx{0};
50  bool _presentation{false};
51  VkQueueFlags _flags{0};
52 
53  std::vector<Queue> _queues;
54  std::unordered_map<std::string, uint32_t> _queuesIndices;
55 };
56 
58 
59 } // API
60 } // Vulkan
61 } // Graphics
62 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11
std::unordered_map< std::string, uint32_t > _queuesIndices
Definition: QueueFamily.hpp:54