18 #ifndef INC_C4AulDefFunc
19 #define INC_C4AulDefFunc
26 inline const static char *FnStringPar(
C4String *pString)
28 return pString ? pString->
GetCStr() :
"";
36 return _this ? _this->
GetObject() :
nullptr;
55 inline Nillable(std::nullptr_t) : _nil(true), _val(T()) {}
58 inline bool IsNil()
const {
return _nil; }
59 inline operator T()
const {
return _val; }
117 template <
typename RType,
typename ThisType,
typename ...ParTypes>
120 template <std::size_t... Is>
121 static C4Value Exec(RType (*pFunc)(ThisType *, ParTypes...), ThisType * _this,
C4Value pPars[], std::index_sequence<Is...>)
127 template <
typename ThisType,
typename ...ParTypes>
130 template <std::size_t... Is>
131 static C4Value Exec(
void (*pFunc)(ThisType *, ParTypes...), ThisType * _this,
C4Value pPars[], std::index_sequence<Is...>)
140 template <
typename T>
213 template <
typename RType,
typename ThisType,
typename ...ParTypes>
218 typedef RType (*
Func)(ThisType *, ParTypes...);
231 return sizeof...(ParTypes);
252 pPars, std::index_sequence_for<ParTypes...>{});
260 template <
typename RType,
typename ThisType,
typename ...ParTypes>
263 new C4AulEngineFunc<RType, ThisType, ParTypes...>(Parent, Name, pFunc, Public);
C4Object * Object(C4PropList *_this)
StdStrBuf FnStringFormat(C4PropList *_this, C4String *szFormatPar, C4Value *Pars, int ParCount)
C4Effect ** FnGetEffectsFor(C4PropList *pTarget)
C4String * String(const char *str)
void AddFunc(C4PropListStatic *Parent, const char *Name, RType(*pFunc)(ThisType *, ParTypes...), bool Public=true)
C4Value C4VFunction(C4AulFunc *pFn)
StdStrBuf FormatString(const char *szFmt,...)
C4Value Exec(C4PropList *p, C4Value pPars[], bool fPassErrors=false) override
C4V_Type GetRetType() const override
const C4V_Type * GetParType() const override
C4AulDefFunc(C4PropListStatic *Parent, C4ScriptFnDef *pDef)
bool GetPublic() const override
bool GetPublic() const override
const C4V_Type * GetParType() const override
C4V_Type ParType[C4AUL_MAX_Par]
C4AulEngineFunc(C4PropListStatic *Parent, const char *pName, Func pFunc, bool Public)
C4V_Type GetRetType() const override
int GetParCount() const override
RType(* Func)(ThisType *, ParTypes...)
C4Value Exec(C4PropList *_this, C4Value pPars[], bool fPassErrors) override
C4RefCntPointer< C4String > Name
const char * GetName() const
C4PropListStatic * Parent
virtual C4Object * GetObject()
virtual C4Effect * GetEffect()
virtual void SetPropertyByS(C4String *k, const C4Value &to)
const char * GetCStr() const
C4String * RegString(StdStrBuf String)
static constexpr bool IsNullableType(C4V_Type Type)
C4PropList * _getPropList() const
C4AulFunc * _getFunction() const
C4ValueArray * _getArray() const
C4String * _getStr() const
C4Object * _getObj() const
NeedNonGlobalContext(const char *function)
NeedObjectContext(const char *function)
Nillable(const Nillable< T > &other)
Nillable(const Nillable< T2 > &n2)
Nillable< T > & operator--()
Nillable< T > & operator++()
Nillable< T > & operator=(const T &val)
C4Value(* FunctionC4V)(C4PropList *_this, C4Value *)
static C4AulFunc * _FromC4V(C4Value &v)
static C4Def * _FromC4V(C4Value &v)
static C4Effect * _FromC4V(C4Value &v)
static C4ID _FromC4V(C4Value &v)
static C4Object * _FromC4V(C4Value &v)
static C4PropList * _FromC4V(C4Value &v)
static C4String * _FromC4V(C4Value &v)
static C4Value _FromC4V(C4Value &v)
static C4ValueArray * _FromC4V(C4Value &v)
static Nillable< T > _FromC4V(C4Value &v)
static bool _FromC4V(C4Value &v)
static const C4Value & _FromC4V(C4Value &v)
static int _FromC4V(C4Value &v)
static C4Value Exec(void(*pFunc)(ThisType *, ParTypes...), ThisType *_this, C4Value pPars[], std::index_sequence< Is... >)
static C4Value Exec(RType(*pFunc)(ThisType *, ParTypes...), ThisType *_this, C4Value pPars[], std::index_sequence< Is... >)
static C4Object * Conv(C4PropList *_this, C4AulFunc *func)
static C4PropList * Conv(C4PropList *_this, C4AulFunc *func)