Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::Method Class Referencefinal

Represents a method. More...

#include <method.h>

Inheritance diagram for sen::Method:

Public Member Functions

 Method (const MethodSpec &spec, Private notUsable)
 Copies the spec into a member. Private to prevent direct instances.
 ~Method () override=default
Constness getConstness () const noexcept
 The constness of the method.
bool getDeferred () const noexcept
 True if the method is marked as deferred.
ConstTypeHandle getReturnType () const noexcept
 Gets the return type of the method (nullptr means void).
const PropertyRelationgetPropertyRelation () const noexcept
 Information about the relation to a property.
bool getLocalOnly () const noexcept
 True if the method is the method is only locally available (within the same component).
bool operator== (const Method &other) const noexcept
 Compares if it is equivalent to another method.
bool operator!= (const Method &other) const noexcept
 Compares if it is not equivalent to another method.
MemberHash getHash () const noexcept
 Returns a unique hash to identify the method.
MemberHash getId () const noexcept
 Returns the hash of the method's unqualified name.
std::string_view getName () const noexcept
 Callable name.
std::string_view getDescription () const noexcept
 Callable description.
TransportMode getTransportMode () const noexcept
 The transport mode of this callable.
Span< const ArggetArgs () const noexcept
 Gets the arguments.
const ArggetArgFromName (std::string_view name) const
 Get the field data given a name. Nullptr means not found.
size_t getArgIndexFromNameHash (MemberHash nameHash) const
 Get the index in the vector of Args given a name hash.
bool operator== (const Callable &other) const noexcept
bool operator!= (const Callable &other) const noexcept

Static Public Member Functions

static std::shared_ptr< Methodmake (MethodSpec spec)
 Factory function that validates the spec and creates a method. Throws std::exception if the spec is not valid.
static void checkSpec (const CallableSpec &spec)
 Throws std::exception if the callable spec is invalid.

Protected Member Functions

const CallableSpecgetCallableSpec () const noexcept
 The spec of this callable.

Detailed Description

Represents a method.

Constructor & Destructor Documentation

◆ Method()

sen::Method::Method ( const MethodSpec & spec,
Private notUsable )

Copies the spec into a member. Private to prevent direct instances.

◆ ~Method()

sen::Method::~Method ( )
overridedefault

Member Function Documentation

◆ make()

std::shared_ptr< Method > sen::Method::make ( MethodSpec spec)
staticnodiscard

Factory function that validates the spec and creates a method. Throws std::exception if the spec is not valid.

◆ getConstness()

Constness sen::Method::getConstness ( ) const
nodiscardnoexcept

The constness of the method.

◆ getDeferred()

bool sen::Method::getDeferred ( ) const
nodiscardnoexcept

True if the method is marked as deferred.

◆ getReturnType()

ConstTypeHandle sen::Method::getReturnType ( ) const
nodiscardnoexcept

Gets the return type of the method (nullptr means void).

◆ getPropertyRelation()

const PropertyRelation & sen::Method::getPropertyRelation ( ) const
nodiscardnoexcept

Information about the relation to a property.

◆ getLocalOnly()

bool sen::Method::getLocalOnly ( ) const
nodiscardnoexcept

True if the method is the method is only locally available (within the same component).

◆ operator==() [1/2]

bool sen::Method::operator== ( const Method & other) const
nodiscardnoexcept

Compares if it is equivalent to another method.

◆ operator!=() [1/2]

bool sen::Method::operator!= ( const Method & other) const
nodiscardnoexcept

Compares if it is not equivalent to another method.

◆ getHash()

MemberHash sen::Method::getHash ( ) const
nodiscardnoexcept

Returns a unique hash to identify the method.

◆ getId()

MemberHash sen::Method::getId ( ) const
nodiscardnoexcept

Returns the hash of the method's unqualified name.

◆ getName()

std::string_view sen::Callable::getName ( ) const
nodiscardnoexceptinherited

Callable name.

◆ getDescription()

std::string_view sen::Callable::getDescription ( ) const
nodiscardnoexceptinherited

Callable description.

◆ getTransportMode()

TransportMode sen::Callable::getTransportMode ( ) const
nodiscardnoexceptinherited

The transport mode of this callable.

◆ getArgs()

Span< const Arg > sen::Callable::getArgs ( ) const
nodiscardnoexceptinherited

Gets the arguments.

◆ getArgFromName()

const Arg * sen::Callable::getArgFromName ( std::string_view name) const
nodiscardinherited

Get the field data given a name. Nullptr means not found.

Parameters
namethe name of the field.

◆ getArgIndexFromNameHash()

size_t sen::Callable::getArgIndexFromNameHash ( MemberHash nameHash) const
nodiscardinherited

Get the index in the vector of Args given a name hash.

◆ operator==() [2/2]

bool sen::Callable::operator== ( const Callable & other) const
nodiscardnoexceptinherited

◆ operator!=() [2/2]

bool sen::Callable::operator!= ( const Callable & other) const
nodiscardnoexceptinherited

◆ checkSpec()

void sen::Callable::checkSpec ( const CallableSpec & spec)
staticinherited

Throws std::exception if the callable spec is invalid.

◆ getCallableSpec()

const CallableSpec & sen::Callable::getCallableSpec ( ) const
nodiscardprotectednoexceptinherited

The spec of this callable.


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