Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TSdlMethod.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <cstddef>
8#include <type_traits>
9
10namespace ph
11{
12
24template<typename MethodStruct, typename TargetType>
25class TSdlMethod : public SdlFunction
26{
27public:
28 using OwnerType = MethodStruct;
29
30public:
31 explicit TSdlMethod(std::string name);
32
33 void call(
34 ISdlResource* resource,
35 SdlInputClauses& clauses,
36 const SdlInputContext& ctx) const override;
37
38 std::size_t numParams() const override;
39 const SdlField* getParam(std::size_t index) const override;
40
41 void callMethod(
42 TargetType& targetType,
43 SdlInputClauses& clauses,
44 const SdlInputContext& ctx) const;
45
46 void loadParameters(
47 MethodStruct& parameterStruct,
48 SdlInputClauses& clauses,
49 const SdlInputContext& ctx) const;
50
51 template<typename T>
52 TSdlMethod& addParam(T sdlField);
53
54 auto description(std::string descriptionStr) -> TSdlMethod&;
55
56 // TODO: support structs?
57
58private:
60};
61
62}// end namespace ph
63
Interface for all SDL resource.
Definition ISdlResource.h:22
Definition SdlField.h:19
Definition SdlFunction.h:18
Container for input clauses.
Definition SdlInputClauses.h:18
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
A set of fields, with basic functionalities.
Definition TSdlBruteForceFieldSet.h:32
SDL binding type for a canonical SDL method.
Definition TSdlMethod.h:26
void call(ISdlResource *resource, SdlInputClauses &clauses, const SdlInputContext &ctx) const override
Definition TSdlMethod.ipp:25
const SdlField * getParam(std::size_t index) const override
Definition TSdlMethod.ipp:104
MethodStruct OwnerType
Definition TSdlMethod.h:28
std::size_t numParams() const override
Definition TSdlMethod.ipp:98
void callMethod(TargetType &targetType, SdlInputClauses &clauses, const SdlInputContext &ctx) const
Definition TSdlMethod.ipp:53
auto description(std::string descriptionStr) -> TSdlMethod &
Definition TSdlMethod.ipp:124
TSdlMethod(std::string name)
Definition TSdlMethod.ipp:20
void loadParameters(MethodStruct &parameterStruct, SdlInputClauses &clauses, const SdlInputContext &ctx) const
Definition TSdlMethod.ipp:74
TSdlMethod & addParam(T sdlField)
The root for all renderer implementations.
Definition EEngineProject.h:6