plugify  1.0.0.0
Public Member Functions | List of all members
plugify::MethodRef Class Reference

A reference class for the Method structure. More...

#include <method.hpp>

Inheritance diagram for plugify::MethodRef:
Inheritance graph
[legend]
Collaboration diagram for plugify::MethodRef:
Collaboration graph
[legend]

Public Member Functions

std::string_view GetName () const noexcept
 < Inherit constructors from Ref<const Method>. More...
 
std::string_view GetFunctionName () const noexcept
 Retrieves the function name of the method. More...
 
std::string_view GetCallingConvention () const noexcept
 Retrieves the calling convention of the method. More...
 
std::span< const PropertyRefGetParamTypes () const noexcept
 Retrieves the parameter types for the method. More...
 
PropertyRef GetReturnType () const noexcept
 Retrieves the return type of the method. More...
 
uint8_t GetVarIndex () const noexcept
 Retrieves the variable index for the method. More...
 
std::optional< MethodRefFindPrototype (std::string_view name) const noexcept
 Attempts to find a prototype method by its name in the current method's parameters or return type. More...
 
- Public Member Functions inherited from plugify::Ref< const Method >
 Ref (const Method &impl) noexcept
 
 Ref (Ref const &)=default
 
 Ref (Ref &&)=default
 
bool operator== (const Ref &other) const noexcept
 
bool operator== (const const Method *impl) const noexcept
 
Refoperator= (const Ref &) &=default
 
Refoperator= (const Ref &) &&=delete
 
Refoperator= (Ref &&) &=default
 
Refoperator= (Ref &&) &&=delete
 
 operator bool () const noexcept
 

Additional Inherited Members

- Protected Attributes inherited from plugify::Ref< const Method >
const Method * _impl
 

Detailed Description

A reference class for the Method structure.

This class holds a reference to a Method object, allowing users to retrieve information such as its name, function name, calling convention, parameter types, return type, and variable index.

Definition at line 118 of file method.hpp.

Member Function Documentation

◆ FindPrototype()

std::optional<MethodRef> plugify::MethodRef::FindPrototype ( std::string_view  name) const
noexcept

Attempts to find a prototype method by its name in the current method's parameters or return type.

This method searches through the parameter types (paramTypes) and return type (retType) of the current method to find a method prototype with the given name. The search is recursive, meaning it will also look into the prototypes of parameter and return types if they themselves have prototypes.

Parameters
nameThe name of the prototype method to search for.
Returns
std::optional<MethodRef>
  • A std::optional<MethodRef> containing the found prototype if a method with the specified name exists, or
  • An empty std::optional if no matching prototype is found.

Example usage:

std::optional<MethodRef> prototype = methodRef.FindPrototype("targetMethodName");
if (prototype) {
// Process the found prototype
}

◆ GetCallingConvention()

std::string_view plugify::MethodRef::GetCallingConvention ( ) const
noexcept

Retrieves the calling convention of the method.

Returns
A string view representing the calling convention.

◆ GetFunctionName()

std::string_view plugify::MethodRef::GetFunctionName ( ) const
noexcept

Retrieves the function name of the method.

Returns
A string view representing the function name of the method.

◆ GetName()

std::string_view plugify::MethodRef::GetName ( ) const
noexcept

< Inherit constructors from Ref<const Method>.

Retrieves the method name.

Returns
A string view representing the name of the method.

◆ GetParamTypes()

std::span<const PropertyRef> plugify::MethodRef::GetParamTypes ( ) const
noexcept

Retrieves the parameter types for the method.

Returns
A span of PropertyRef objects representing the parameter types.

◆ GetReturnType()

PropertyRef plugify::MethodRef::GetReturnType ( ) const
noexcept

Retrieves the return type of the method.

Returns
A PropertyRef representing the return type of the method.

◆ GetVarIndex()

uint8_t plugify::MethodRef::GetVarIndex ( ) const
noexcept

Retrieves the variable index for the method.

Returns
An 8-bit unsigned integer representing the variable index.

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