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::ConsoleFunctor< _TYPE, _REPLICATES_VALUE > Class Template Referencefinal

Console functor which wraps a function call into an object instance. More...

#include <ConsoleFunctor.h>

Inherits AZ::ConsoleFunctorBase.

Public Types

using MemberFunctorSignature = typename ConsoleCommandMemberFunctorSignature< _TYPE >::type
 
using RawFunctorSignature = void(*)(_TYPE &, const ConsoleCommandContainer &)
 
using FunctorUnion = AZStd::conditional_t< AZStd::is_same_v< RawFunctorSignature, MemberFunctorSignature >, AZStd::variant< RawFunctorSignature >, AZStd::variant< RawFunctorSignature, MemberFunctorSignature > >
 

Public Member Functions

 ConsoleFunctor (const char *name, const char *desc, ConsoleFunctorFlags flags, const TypeId &typeId, _TYPE &object, FunctorUnion function)
 
 ConsoleFunctor (IConsole &console, const char *name, const char *desc, ConsoleFunctorFlags flags, const TypeId &typeId, _TYPE &object, FunctorUnion function)
 
 ConsoleFunctor (ConsoleFunctor &&)=default
 
ConsoleFunctoroperator= (ConsoleFunctor &&)=default
 
_TYPE & GetValue ()
 
void operator() (const ConsoleCommandContainer &arguments) override
 
bool GetReplicationString (CVarFixedString &outString) const override
 
- Public Member Functions inherited from AZ::ConsoleFunctorBase
 ConsoleFunctorBase (const char *name, const char *desc, ConsoleFunctorFlags flags, const TypeId &typeId)
 
 ConsoleFunctorBase (AZ::IConsole &console, const char *name, const char *desc, ConsoleFunctorFlags flags, const TypeId &typeId)
 
 ConsoleFunctorBase (ConsoleFunctorBase &&other)
 
ConsoleFunctorBaseoperator= (ConsoleFunctorBase &&other)
 
virtual ~ConsoleFunctorBase ()
 Destructor.
 
const char * GetName () const
 
const char * GetDesc () const
 
ConsoleFunctorFlags GetFlags () const
 
const TypeIdGetTypeId () const
 
virtual void operator() (const ConsoleCommandContainer &arguments)=0
 
virtual bool GetReplicationString (CVarFixedString &outString) const =0
 
template<typename RETURN_TYPE >
GetValueResult GetValue (RETURN_TYPE &outResult) const
 

Additional Inherited Members

- Static Public Member Functions inherited from AZ::ConsoleFunctorBase
static ConsoleFunctorBase *& GetDeferredHead ()
 Used internally to link cvars and functors from various modules to the console as they are loaded.
 
- Protected Member Functions inherited from AZ::ConsoleFunctorBase
virtual GetValueResult GetValueAsString (CVarFixedString &outString) const
 
void Link (ConsoleFunctorBase *&head)
 
void Unlink (ConsoleFunctorBase *&head)
 
- Protected Attributes inherited from AZ::ConsoleFunctorBase
const char * m_name = ""
 
const char * m_desc = ""
 
ConsoleFunctorFlags m_flags = ConsoleFunctorFlags::Null
 
TypeId m_typeId
 
IConsolem_console = nullptr
 
ConsoleFunctorBasem_prev = nullptr
 
ConsoleFunctorBasem_next = nullptr
 
bool m_isDeferred = true
 
- Static Protected Attributes inherited from AZ::ConsoleFunctorBase
static ConsoleFunctorBases_deferredHead
 
static bool s_deferredHeadInvoked
 

Detailed Description

template<typename _TYPE, bool _REPLICATES_VALUE>
class AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >

Console functor which wraps a function call into an object instance.

Console functor specialization for non-member console functions (no instance to invoke on).

Constructor & Destructor Documentation

◆ ConsoleFunctor()

template<typename _TYPE , bool _REPLICATES_VALUE>
AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >::ConsoleFunctor ( const char *  name,
const char *  desc,
ConsoleFunctorFlags  flags,
const TypeId typeId,
_TYPE &  object,
FunctorUnion  function 
)
inline

Constructors.

Parameters
namethe string name of the functor, used to identify and invoke the functor through the console interface
desca string help description of the functor
flagsa set of flags that mutate the behaviour of the functor
typeIdthe TypeId associated with this console functor
objectreference to the data storage object

Member Function Documentation

◆ GetReplicationString()

template<typename _TYPE , bool _REPLICATES_VALUE>
bool AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >::GetReplicationString ( CVarFixedString outString) const
inlineoverridevirtual

For functors that can be replicated (cvars). This will generate a replication string suitable for remote execution

Parameters
outStringthe output string which can be remotely executed
Returns
boolean true if a proper replicated value was returned, false otherwise

Implements AZ::ConsoleFunctorBase.

◆ GetValue()

template<typename _TYPE , bool _REPLICATES_VALUE>
_TYPE & AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >::GetValue
inline

Returns reference typed stored type wrapped stored by ConsoleFunctor.

Returns
reference to underlying type

◆ operator()()

template<typename _TYPE , bool _REPLICATES_VALUE>
void AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >::operator() ( const ConsoleCommandContainer arguments)
inlineoverridevirtual

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