SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
StateResource.h
1#pragma once
2
3#include "spark/render/Export.h"
4
5#include <memory>
6#include <string>
7
8namespace spark::render
9{
13 class SPARK_RENDER_EXPORT IStateResource
14 {
15 public:
16 virtual ~IStateResource() noexcept = default;
17
22 [[nodiscard]] virtual const std::string& name() const noexcept = 0;
23 };
24
28 class SPARK_RENDER_EXPORT StateResource : public virtual IStateResource
29 {
30 public:
35 explicit StateResource(std::string_view name) noexcept;
36 ~StateResource() noexcept override;
37
38 StateResource(const StateResource& other) = delete;
39 StateResource(StateResource&& other) noexcept;
40 StateResource& operator=(const StateResource& other) = delete;
41 StateResource& operator=(StateResource&& other) noexcept;
42
44 [[nodiscard]] const std::string& name() const noexcept final;
45
46 protected:
48 explicit StateResource() noexcept;
49
51 [[nodiscard]] std::string& name() noexcept;
52
53 private:
54 struct Impl;
55 std::unique_ptr<Impl> m_impl;
56 };
57}
Interface for a state resource.
Definition StateResource.h:14
virtual const std::string & name() const noexcept=0
Gets the name of the state resource.
Base class for a resource that can be identified by a name in a DeviceState.
Definition StateResource.h:29
Definition StateResource.cpp:6