Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SdlStructFieldStump.ipp
Go to the documentation of this file.
1#pragma once
2
6
7#include <Common/assertion.h>
8
9#include <type_traits>
10#include <utility>
11#include <memory>
12
13namespace ph
14{
15
16template<typename StructType, typename Owner>
17inline auto SdlStructFieldStump::genFieldSet(StructType Owner::* const structObjPtr) const
19{
20 // TODO: require StructType has getSdlFunction()
21
22 PH_ASSERT(structObjPtr);
23
24 auto const sdlStruct = StructType::getSdlStruct();
25 const auto& structFields = sdlStruct->getFields();
26
28 for(std::size_t i = 0; i < structFields.numFields(); ++i)
29 {
30 const auto& structField = structFields[i];
31
33 structObjPtr,
34 &structField);
35
36 fieldSet.addField(nestedField);
37 }
38
39 return fieldSet;
40}
41
42}// end namespace ph
auto genFieldSet(StructType Owner::*structObjPtr) const -> TSdlBruteForceFieldSet< TSdlOwnedField< Owner > >
Definition SdlStructFieldStump.ipp:17
A set of fields, with basic functionalities.
Definition TSdlBruteForceFieldSet.h:32
auto addField(T field) -> TSdlBruteForceFieldSet &
Definition TSdlBruteForceFieldSet.h:54
A field that lives within an inner object.
Definition TSdlNestedField.h:25
Abstraction for a value that is owned by some owner type. Governs how a field should be initialized o...
Definition TSdlOwnedField.h:15
The root for all renderer implementations.
Definition EEngineProject.h:6