Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::TSdlMethod< MethodStruct, TargetType > Class Template Reference

SDL binding type for a canonical SDL method. More...

#include <TSdlMethod.h>

Inheritance diagram for ph::TSdlMethod< MethodStruct, TargetType >:
ph::SdlFunction ph::ISdlInstantiable

Public Types

using OwnerType = MethodStruct
 

Public Member Functions

 TSdlMethod (std::string name)
 
void call (ISdlResource *resource, SdlInputClauses &clauses, const SdlInputContext &ctx) const override
 
std::size_t numParams () const override
 
const SdlFieldgetParam (std::size_t index) const override
 
void callMethod (TargetType &targetType, SdlInputClauses &clauses, const SdlInputContext &ctx) const
 
void loadParameters (MethodStruct &parameterStruct, SdlInputClauses &clauses, const SdlInputContext &ctx) const
 
template<typename T >
TSdlMethodaddParam (T sdlField)
 
auto description (std::string descriptionStr) -> TSdlMethod &
 
template<typename T >
auto addParam (T sdlField) -> TSdlMethod &
 
- Public Member Functions inherited from ph::SdlFunction
 SdlFunction (std::string name)
 
std::size_t numFields () const override
 
const SdlFieldgetField (std::size_t index) const override
 
std::string_view getTypeName () const override
 
std::string_view getDescription () const override
 
std::string_view getName () const
 
std::string genPrettyName () const
 
- Public Member Functions inherited from ph::ISdlInstantiable
virtual ~ISdlInstantiable ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from ph::SdlFunction
SdlFunctionsetDescription (std::string description)
 

Detailed Description

template<typename MethodStruct, typename TargetType>
class ph::TSdlMethod< MethodStruct, TargetType >

SDL binding type for a canonical SDL method.

For a method to be callable in SDL, it must be defined as a C++ functor that takes an instance of TargetType as its only input. Other arguments to the method should be accessed via the functor's member variables. Each member variables then can be binded much like the members of a canonical SDL resource.

Template Parameters
MethodStructType of the functor.
TargetTypeType that defines the method. May be any C++ class/struct type including SDL resource types.

Member Typedef Documentation

◆ OwnerType

template<typename MethodStruct , typename TargetType >
using ph::TSdlMethod< MethodStruct, TargetType >::OwnerType = MethodStruct

Constructor & Destructor Documentation

◆ TSdlMethod()

template<typename MethodStruct , typename TargetType >
ph::TSdlMethod< MethodStruct, TargetType >::TSdlMethod ( std::string name)
inlineexplicit

Member Function Documentation

◆ addParam() [1/2]

template<typename MethodStruct , typename TargetType >
template<typename T >
TSdlMethod & ph::TSdlMethod< MethodStruct, TargetType >::addParam ( T sdlField)

◆ addParam() [2/2]

template<typename MethodStruct , typename TargetType >
template<typename T >
auto ph::TSdlMethod< MethodStruct, TargetType >::addParam ( T sdlField) -> TSdlMethod&
inline

◆ call()

template<typename MethodStruct , typename TargetType >
void ph::TSdlMethod< MethodStruct, TargetType >::call ( ISdlResource * resource,
SdlInputClauses & clauses,
const SdlInputContext & ctx ) const
inlineoverridevirtual

Implements ph::SdlFunction.

◆ callMethod()

template<typename MethodStruct , typename TargetType >
void ph::TSdlMethod< MethodStruct, TargetType >::callMethod ( TargetType & targetType,
SdlInputClauses & clauses,
const SdlInputContext & ctx ) const
inline

◆ description()

template<typename MethodStruct , typename TargetType >
auto ph::TSdlMethod< MethodStruct, TargetType >::description ( std::string descriptionStr) -> TSdlMethod&
inline

◆ getParam()

template<typename MethodStruct , typename TargetType >
const SdlField * ph::TSdlMethod< MethodStruct, TargetType >::getParam ( std::size_t index) const
inlineoverridevirtual

Implements ph::SdlFunction.

◆ loadParameters()

template<typename MethodStruct , typename TargetType >
void ph::TSdlMethod< MethodStruct, TargetType >::loadParameters ( MethodStruct & parameterStruct,
SdlInputClauses & clauses,
const SdlInputContext & ctx ) const
inline

◆ numParams()

template<typename MethodStruct , typename TargetType >
std::size_t ph::TSdlMethod< MethodStruct, TargetType >::numParams ( ) const
inlineoverridevirtual

Implements ph::SdlFunction.


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