Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::SdlStruct Class Referenceabstract

#include <SdlStruct.h>

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

Public Member Functions

 SdlStruct (std::string typeName)
 
virtual void initObject (AnyNonConstPtr obj, SdlInputClauses &clauses, const SdlInputContext &ctx) const =0
 Initialize a struct object from value clauses. How the object will be initialized depends on the struct's SDL definition.
 
virtual void initDefaultObject (AnyNonConstPtr obj) const =0
 Initialize a struct object to default values. Default values are defined by the struct's SDL definition.
 
virtual void saveObject (AnyConstPtr obj, SdlOutputClauses &clauses, const SdlOutputContext &ctx) const =0
 
virtual void referencedResources (AnyConstPtr obj, std::vector< const ISdlResource * > &out_resources) const =0
 Get all SDL resources referenced by obj.
 
std::size_t numFields () const override=0
 
const SdlFieldgetField (std::size_t index) const override=0
 
std::string_view getTypeName () const override
 
std::string_view getDescription () const override
 
- Public Member Functions inherited from ph::ISdlInstantiable
virtual ~ISdlInstantiable ()=default
 

Protected Member Functions

SdlStructsetDescription (std::string description)
 

Detailed Description

SDL struct is designed to be a simple grouped data carrier without the burden of inheritance and member functions for efficiency and ease of reuse.

TSdl provides a simplified interface for initializing instances to default values.

Constructor & Destructor Documentation

◆ SdlStruct()

ph::SdlStruct::SdlStruct ( std::string typeName)
explicit

Member Function Documentation

◆ getDescription()

std::string_view ph::SdlStruct::getDescription ( ) const
inlineoverridevirtual
Returns
A description of this instantiable.

Implements ph::ISdlInstantiable.

◆ getField()

const SdlField * ph::SdlStruct::getField ( std::size_t index) const
overridepure virtual
Returns
Field at index. index must <= numFields().

Implements ph::ISdlInstantiable.

Implemented in ph::TSdlOwnerStruct< StructType >.

◆ getTypeName()

std::string_view ph::SdlStruct::getTypeName ( ) const
inlineoverridevirtual
Returns
Type name of this instantiable.

Implements ph::ISdlInstantiable.

◆ initDefaultObject()

virtual void ph::SdlStruct::initDefaultObject ( AnyNonConstPtr obj) const
pure virtual

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

Implemented in ph::TSdlOwnerStruct< StructType >.

◆ initObject()

virtual void ph::SdlStruct::initObject ( AnyNonConstPtr obj,
SdlInputClauses & clauses,
const SdlInputContext & ctx ) const
pure virtual

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

Implemented in ph::TSdlOwnerStruct< StructType >.

◆ numFields()

std::size_t ph::SdlStruct::numFields ( ) const
overridepure virtual
Returns
Number of fields in this instantiable.

Implements ph::ISdlInstantiable.

Implemented in ph::TSdlOwnerStruct< StructType >.

◆ referencedResources()

virtual void ph::SdlStruct::referencedResources ( AnyConstPtr obj,
std::vector< const ISdlResource * > & out_resources ) const
pure virtual

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.

Implemented in ph::TSdlOwnerStruct< StructType >.

◆ saveObject()

virtual void ph::SdlStruct::saveObject ( AnyConstPtr obj,
SdlOutputClauses & clauses,
const SdlOutputContext & ctx ) const
pure virtual

◆ setDescription()

SdlStruct & ph::SdlStruct::setDescription ( std::string description)
protected

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