Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SdlOutputContext.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_fwd.h"
5
6#include <utility>
7#include <string>
8#include <string_view>
9#include <type_traits>
10
11namespace ph { class Path; }
12
13namespace ph
14{
15
18class SdlOutputContext final : public SdlIOContext
19{
20public:
22
23 explicit SdlOutputContext(
24 const Path* workingDirectory,
25 const SdlClass* srcClass = nullptr,
26 const SdlStruct* srcStruct = nullptr);
27
29 const SdlDependencyResolver* dependencyResolver,
30 SdlNamedOutputClauses* namedOutputClauses,
31 const Path* workingDirectory,
32 const SdlClass* srcClass = nullptr,
33 const SdlStruct* srcStruct = nullptr);
34
37
42 std::string_view getResourceName(const ISdlResource* resource) const;
43
44private:
45 const SdlDependencyResolver* m_dependencyResolver;
46 SdlNamedOutputClauses* m_namedOutputClauses;
47};
48
49// Try to make the context trivially copyable, so mock contexts and copy-and-modified contexts can
50// be cheaper to create.
51static_assert(std::is_trivially_copyable_v<SdlOutputContext>);
52
53// In-header Implementation:
54
56
57 : SdlIOContext()
58
59 , m_dependencyResolver(nullptr)
60 , m_namedOutputClauses(nullptr)
61{}
62
64 const Path* const workingDirectory,
65 const SdlClass* const srcClass,
66 const SdlStruct* const srcStruct)
67
69 nullptr,
70 nullptr,
71 workingDirectory,
72 srcClass,
73 srcStruct)
74{}
75
77 const SdlDependencyResolver* const dependencyResolver,
78 SdlNamedOutputClauses* const namedOutputClauses,
79 const Path* const workingDirectory,
80 const SdlClass* const srcClass,
81 const SdlStruct* const srcStruct)
82
84 workingDirectory,
85 srcClass,
86 srcStruct)
87
88 , m_dependencyResolver(dependencyResolver)
89 , m_namedOutputClauses(namedOutputClauses)
90{}
91
93{
94 return m_dependencyResolver;
95}
96
98{
99 return m_namedOutputClauses;
100}
101
102}// end namespace ph
Interface for all SDL resource.
Definition ISdlResource.h:22
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Definition SdlClass.h:25
Resolves dependency between SDL resources and provides a valid initialization order....
Definition SdlDependencyResolver.h:21
Data that SDL input/output process can rely on.
Definition SdlIOContext.h:17
Definition SdlNamedOutputClauses.h:18
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
SdlOutputContext()
Definition SdlOutputContext.h:55
const SdlDependencyResolver * getDependencyResolver() const
Definition SdlOutputContext.h:92
std::string_view getResourceName(const ISdlResource *resource) const
Definition SdlOutputContext.cpp:9
SdlNamedOutputClauses * getNamedOutputClauses() const
Definition SdlOutputContext.h:97
Definition SdlStruct.h:25
The root for all renderer implementations.
Definition EEngineProject.h:6