Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TSdlAbstractValue.ipp
Go to the documentation of this file.
1#pragma once
2
4
5namespace ph
6{
7
8template<typename T, typename Owner>
10 std::string typeName,
11 std::string valueName)
12
13 : TSdlOwnedField<Owner>(
14 std::move(typeName),
15 std::move(valueName))
16{}
17
18template<typename T, typename Owner>
20 std::string typeName,
21 std::string valueName,
22 std::string typeSignature)
24 : TSdlOwnedField<Owner>(
25 std::move(typeName),
26 std::move(valueName),
27 std::move(typeSignature))
28{}
29
30template<typename T, typename Owner>
31inline std::string TSdlAbstractValue<T, Owner>::valueToString(const Owner& owner) const
32{
33 const T* const valuePtr = getConstValue(owner);
34 return valuePtr ? valueAsString(*valuePtr) : "(empty)";
35}
36
37template<typename T, typename Owner>
39 const Owner& /* owner */,
40 std::vector<const ISdlResource*>& /* out_resources */) const
41{
42 // Returns nullptr always--SDL value is not a reference type and thus cannot have
43 // associated resource
44 //
45 // Nothing to return.
46}
47
48}// end namespace ph
std::string valueToString(const Owner &owner) const override
Convert the value of the field to human-readable string.
Definition TSdlAbstractValue.ipp:31
void ownedResources(const Owner &owner, std::vector< const ISdlResource * > &out_resources) const override
Get all SDL resources associated by owner.
Definition TSdlAbstractValue.ipp:38
TSdlAbstractValue(std::string typeName, std::string valueName)
Definition TSdlAbstractValue.ipp:9
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
Definition TAABB2D.h:96