Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::BehaviorMethod Class Referenceabstract

#include <BehaviorContext.h>

Inherits AZ::OnDemandReflectionOwner.

Inherited by AZ::Internal::BehaviorEBusEvent, and AZ::Internal::BehaviorMethodImpl.

Public Types

using ResultOutcome = AZ::Outcome< void, AZStd::string >
 

Public Member Functions

 BehaviorMethod (BehaviorContext *context)
 
template<class... Args>
bool Invoke (Args &&... args) const
 
bool Invoke () const
 
template<class R , class... Args>
bool InvokeResult (R &r, Args &&... args) const
 
template<class R >
bool InvokeResult (R &r) const
 
void SetDeprecatedName (AZStd::string name)
 
const AZStd::stringGetDeprecatedName () const
 
virtual bool Call (AZStd::span< BehaviorArgument > arguments, BehaviorArgument *result=nullptr) const =0
 
bool Call (BehaviorArgument *arguments, unsigned int numArguments, BehaviorArgument *result=nullptr) const
 
virtual ResultOutcome IsCallable (AZStd::span< BehaviorArgument > arguments, BehaviorArgument *result=nullptr) const =0
 
virtual bool HasResult () const =0
 
virtual bool IsMember () const =0
 Returns true if the method is a class member method. If true the first argument should always be the "this"/ClassType pointer.
 
virtual bool HasBusId () const =0
 Returns true if the method is an ebus method with a bus id argument.
 
virtual const BehaviorParameterGetBusIdArgument () const =0
 Returns the BehaviorParameter corresponding to the the ebus BusId argument if the ebus method is addressed by Id.
 
virtual void OverrideParameterTraits (size_t index, AZ::u32 addTraits, AZ::u32 removeTraits)=0
 
virtual size_t GetNumArguments () const =0
 
virtual size_t GetMinNumberOfArguments () const =0
 Return the minimum number of arguments needed (considering default arguments)
 
virtual const BehaviorParameterGetArgument (size_t index) const =0
 
virtual const AZStd::stringGetArgumentName (size_t index) const =0
 
virtual void SetArgumentName (size_t index, AZStd::string name)=0
 
virtual const AZStd::stringGetArgumentToolTip (size_t index) const =0
 
virtual void SetArgumentToolTip (size_t index, AZStd::string name)=0
 
virtual void SetDefaultValue (size_t index, BehaviorDefaultValuePtr defaultValue)=0
 
virtual BehaviorDefaultValuePtr GetDefaultValue (size_t index) const =0
 
virtual const BehaviorParameterGetResult () const =0
 
void ProcessAuxiliaryMethods (BehaviorContext *context, BehaviorMethod &method)
 
bool AddOverload (BehaviorMethod *method)
 
bool IsAnOverload (BehaviorMethod *candidate) const
 
- Public Member Functions inherited from AZ::OnDemandReflectionOwner
 OnDemandReflectionOwner (const OnDemandReflectionOwner &)=delete
 
OnDemandReflectionOwneroperator= (const OnDemandReflectionOwner &)=delete
 
 OnDemandReflectionOwner (OnDemandReflectionOwner &&)=delete
 
OnDemandReflectionOwneroperator= (OnDemandReflectionOwner &&)=delete
 
void AddReflectFunction (AZ::Uuid typeId, StaticReflectionFunctionPtr reflectFunction)
 Register an OnDemandReflection function.
 

Public Attributes

BehaviorMethodm_overload = nullptr
 
AZStd::string m_name
 Debug friendly behavior method name.
 
AZStd::string m_deprecatedName
 this is the deprecated name of this method
 
const char * m_debugDescription
 
bool m_isConst = false
 Is member function const (false if not a member function)
 
AttributeArray m_attributes
 Attributes for the method.
 

Additional Inherited Members

- Protected Member Functions inherited from AZ::OnDemandReflectionOwner
 OnDemandReflectionOwner (ReflectContext &context)
 Constructor to be called by child class.
 

Detailed Description

Use behavior method to get type information and invoke reflected methods.

Member Function Documentation

◆ IsCallable()

virtual ResultOutcome AZ::BehaviorMethod::IsCallable ( AZStd::span< BehaviorArgument arguments,
BehaviorArgument result = nullptr 
) const
pure virtual

Returns success if the method is callable with the supplied arguments otherwise an error message is returned with the reason the method is not callable


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