Lugdunum  0.1.0
CommandPool.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace lug {
7 namespace Graphics {
8 namespace Vulkan {
9 namespace API {
10 
11 namespace Builder {
12 class CommandPool;
13 } // Builder
14 
15 class Device;
16 class Queue;
17 
19  friend class Builder::CommandPool;
20 
21 public:
22  CommandPool() = default;
23 
24  CommandPool(const CommandPool&) = delete;
25  // Warning: Don't move CommandPool after creating a CommandBuffer
27 
28  CommandPool& operator=(const CommandPool&) = delete;
29  // Warning: Don't move CommandPool after creating a CommandBuffer
30  CommandPool& operator=(CommandPool&& CommandPool);
31 
32  ~CommandPool();
33 
34  explicit operator VkCommandPool() const {
35  return _commandPool;
36  }
37 
38  const Device* getDevice() const;
39  const Queue* getQueue() const;
40 
41  bool reset(bool releaseRessources = false) const;
42 
43  // Warning: Command buffers created with this pool must have been destroyed
44  void destroy();
45 
46 private:
47  explicit CommandPool(VkCommandPool commandPool, const Device *device, const Queue *queue);
48 
49 private:
50  VkCommandPool _commandPool{VK_NULL_HANDLE};
51  const Device* _device{nullptr};
52 
53  const Queue* _queue{nullptr};
54 };
55 
57 
58 } // API
59 } // Vulkan
60 } // Graphics
61 } // lug
#define LUG_GRAPHICS_API
Definition: Export.hpp:11