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::ConsoleFunctorBase Class Referenceabstract

#include <ConsoleFunctor.h>

Inherited by AZ::ConsoleFunctor< ConsoleDataWrapper< BASE_TYPE, THREAD_SAFETY >, true >, AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >, and AZ::ConsoleFunctor< void, _REPLICATES_VALUE >.

Public Member Functions

 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
 

Static Public Member Functions

static ConsoleFunctorBase *& GetDeferredHead ()
 Used internally to link cvars and functors from various modules to the console as they are loaded.
 

Protected Member Functions

virtual GetValueResult GetValueAsString (CVarFixedString &outString) const
 
void Link (ConsoleFunctorBase *&head)
 
void Unlink (ConsoleFunctorBase *&head)
 

Protected Attributes

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

static ConsoleFunctorBases_deferredHead
 
static bool s_deferredHeadInvoked
 

Friends

class Console
 

Detailed Description

Base class for console functors.

Constructor & Destructor Documentation

◆ ConsoleFunctorBase() [1/3]

AZ::ConsoleFunctorBase::ConsoleFunctorBase ( const char *  name,
const char *  desc,
ConsoleFunctorFlags  flags,
const TypeId typeId 
)

Constructor.

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

◆ ConsoleFunctorBase() [2/3]

AZ::ConsoleFunctorBase::ConsoleFunctorBase ( AZ::IConsole console,
const char *  name,
const char *  desc,
ConsoleFunctorFlags  flags,
const TypeId typeId 
)

Console registration constructor.

Parameters
consolereference to valid console interface that the console functor will register with
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

◆ ConsoleFunctorBase() [3/3]

AZ::ConsoleFunctorBase::ConsoleFunctorBase ( ConsoleFunctorBase &&  other)

Move Constructor Unlinks the old console functor base address of the console interface and links the new console base instance to it

Member Function Documentation

◆ GetDesc()

const char * AZ::ConsoleFunctorBase::GetDesc ( ) const
inline

Returns the help descriptor of this functor.

Returns
the help descriptor of this functor

◆ GetFlags()

ConsoleFunctorFlags AZ::ConsoleFunctorBase::GetFlags ( ) const
inline

Returns the flags set on this functor instance.

Returns
the flags set on this functor instance

◆ GetName()

const char * AZ::ConsoleFunctorBase::GetName ( ) const
inline

Returns the string name of this functor.

Returns
the string name of this functor

◆ GetReplicationString()

virtual bool AZ::ConsoleFunctorBase::GetReplicationString ( CVarFixedString outString) const
pure virtual

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

Implemented in AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >, AZ::ConsoleFunctor< ConsoleDataWrapper< BASE_TYPE, THREAD_SAFETY >, true >, and AZ::ConsoleFunctor< void, _REPLICATES_VALUE >.

◆ GetTypeId()

const TypeId & AZ::ConsoleFunctorBase::GetTypeId ( ) const
inline

Returns the TypeId of the bound type if one exists.

Returns
the TypeId of the bound type if one exists

◆ GetValue()

template<typename RETURN_TYPE >
GetValueResult AZ::ConsoleFunctorBase::GetValue ( RETURN_TYPE &  outResult) const
inline

Attempts to retrieve the functor object instance as the provided type.

Parameters
outResultthe value to store the result in
Returns
GetConsoleValueResult::Success or an appropriate error code

◆ operator()()

virtual void AZ::ConsoleFunctorBase::operator() ( const ConsoleCommandContainer arguments)
pure virtual

Execute operator, calling this executes the functor.

Parameters
argumentsset of string inputs to the functor

Implemented in AZ::ConsoleFunctor< _TYPE, _REPLICATES_VALUE >, AZ::ConsoleFunctor< ConsoleDataWrapper< BASE_TYPE, THREAD_SAFETY >, true >, and AZ::ConsoleFunctor< void, _REPLICATES_VALUE >.


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