Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TSdlOwnerStruct< StructType > Class Template Reference

SDL binding type for a typical C++ struct. More...

#include <TSdlOwnerStruct.h>

Inheritance diagram for ph::TSdlOwnerStruct< StructType >:
ph::SdlStruct ph::ISdlInstantiable

Public Types

using OwnerType = StructType
 

Public Member Functions

 TSdlOwnerStruct (std::string name)
 
void initObject (AnyNonConstPtr obj, SdlInputClauses &clauses, const SdlInputContext &ctx) const override
 Initialize a struct object from value clauses. How the object will be initialized depends on the struct's SDL definition.
 
void initDefaultObject (AnyNonConstPtr obj) const override
 Initialize a struct object to default values. Default values are defined by the struct's SDL definition.
 
void saveObject (AnyConstPtr obj, SdlOutputClauses &clauses, const SdlOutputContext &ctx) const override
 
void referencedResources (AnyConstPtr obj, std::vector< const ISdlResource * > &out_resources) const override
 Get all SDL resources referenced by obj.
 
void initDefaultStruct (StructType &structObj) const
 Initialize the struct object to default values.
 
std::size_t numFields () const override
 
const SdlFieldgetField (std::size_t index) const override
 
template<typename T >
TSdlOwnerStructaddField (T sdlField)
 
template<typename StructObjType >
TSdlOwnerStructaddStruct (StructObjType StructType::*structObjPtr)
 
template<typename StructObjType >
TSdlOwnerStructaddStruct (StructObjType StructType::*structObjPtr, const SdlStructFieldStump &structFieldStump)
 
auto getFields () const -> const TSdlBruteForceFieldSet< TSdlOwnedField< StructType > > &
 
TSdlOwnerStructdescription (std::string descriptionStr)
 
template<typename T >
auto addField (T sdlField) -> TSdlOwnerStruct &
 
template<typename StructObjType >
auto addStruct (StructObjType StructType::*const structObjPtr) -> TSdlOwnerStruct &
 
template<typename StructObjType >
auto addStruct (StructObjType StructType::*const structObjPtr, const SdlStructFieldStump &structFieldStump) -> TSdlOwnerStruct &
 
- Public Member Functions inherited from ph::SdlStruct
 SdlStruct (std::string typeName)
 
std::string_view getTypeName () const override
 
std::string_view getDescription () const override
 
- Public Member Functions inherited from ph::ISdlInstantiable
virtual ~ISdlInstantiable ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from ph::SdlStruct
SdlStructsetDescription (std::string description)
 

Detailed Description

template<typename StructType>
class ph::TSdlOwnerStruct< StructType >

SDL binding type for a typical C++ struct.

Member Typedef Documentation

◆ OwnerType

template<typename StructType >
using ph::TSdlOwnerStruct< StructType >::OwnerType = StructType

Constructor & Destructor Documentation

◆ TSdlOwnerStruct()

template<typename StructType >
ph::TSdlOwnerStruct< StructType >::TSdlOwnerStruct ( std::string name)
inlineexplicit

Member Function Documentation

◆ addField() [1/2]

template<typename StructType >
template<typename T >
TSdlOwnerStruct & ph::TSdlOwnerStruct< StructType >::addField ( T sdlField)

◆ addField() [2/2]

template<typename StructType >
template<typename T >
auto ph::TSdlOwnerStruct< StructType >::addField ( T sdlField) -> TSdlOwnerStruct&
inline

◆ addStruct() [1/4]

template<typename StructType >
template<typename StructObjType >
auto ph::TSdlOwnerStruct< StructType >::addStruct ( StructObjType StructType::*const structObjPtr) -> TSdlOwnerStruct&
inline

◆ addStruct() [2/4]

template<typename StructType >
template<typename StructObjType >
auto ph::TSdlOwnerStruct< StructType >::addStruct ( StructObjType StructType::*const structObjPtr,
const SdlStructFieldStump & structFieldStump ) -> TSdlOwnerStruct&
inline

◆ addStruct() [3/4]

template<typename StructType >
template<typename StructObjType >
TSdlOwnerStruct & ph::TSdlOwnerStruct< StructType >::addStruct ( StructObjType StructType::* structObjPtr)

◆ addStruct() [4/4]

template<typename StructType >
template<typename StructObjType >
TSdlOwnerStruct & ph::TSdlOwnerStruct< StructType >::addStruct ( StructObjType StructType::* structObjPtr,
const SdlStructFieldStump & structFieldStump )

◆ description()

template<typename StructType >
auto ph::TSdlOwnerStruct< StructType >::description ( std::string descriptionStr)
inline

◆ getField()

template<typename StructType >
const SdlField * ph::TSdlOwnerStruct< StructType >::getField ( std::size_t index) const
inlineoverridevirtual
Returns
Field at index. index must <= numFields().

Implements ph::SdlStruct.

◆ getFields()

template<typename StructType >
auto ph::TSdlOwnerStruct< StructType >::getFields ( ) const -> const TSdlBruteForceFieldSet<TSdlOwnedField<StructType>>&
inline

◆ initDefaultObject()

template<typename StructType >
void ph::TSdlOwnerStruct< StructType >::initDefaultObject ( AnyNonConstPtr obj) const
inlineoverridevirtual

Initialize a struct object to default values. Default values are defined by the struct's SDL definition.

Implements ph::SdlStruct.

◆ initDefaultStruct()

template<typename StructType >
void ph::TSdlOwnerStruct< StructType >::initDefaultStruct ( StructType & structObj) const
inline

Initialize the struct object to default values.

◆ initObject()

template<typename StructType >
void ph::TSdlOwnerStruct< StructType >::initObject ( AnyNonConstPtr obj,
SdlInputClauses & clauses,
const SdlInputContext & ctx ) const
inlineoverridevirtual

Initialize a struct object from value clauses. How the object will be initialized depends on the struct's SDL definition.

Implements ph::SdlStruct.

◆ numFields()

template<typename StructType >
std::size_t ph::TSdlOwnerStruct< StructType >::numFields ( ) const
inlineoverridevirtual
Returns
Number of fields in this instantiable.

Implements ph::SdlStruct.

◆ referencedResources()

template<typename StructType >
void ph::TSdlOwnerStruct< StructType >::referencedResources ( AnyConstPtr obj,
std::vector< const ISdlResource * > & out_resources ) const
inlineoverridevirtual

Get all SDL resources referenced by obj.

Parameters
objThe object that may contain SDL resources.
out_resourcesSDL resources referenced by obj. Never contains null. Appends to existing ones.

Implements ph::SdlStruct.

◆ saveObject()

template<typename StructType >
void ph::TSdlOwnerStruct< StructType >::saveObject ( AnyConstPtr obj,
SdlOutputClauses & clauses,
const SdlOutputContext & ctx ) const
inlineoverridevirtual

Implements ph::SdlStruct.


The documentation for this class was generated from the following files: