40 #ifndef AS_SCRIPTFUNCTION_H 41 #define AS_SCRIPTFUNCTION_H 43 #include "as_config.h" 44 #include "as_string.h" 45 #include "as_memory.h" 46 #include "as_datatype.h" 47 #include "as_atomic.h" 63 asUINT declaredAtProgramPos;
66 enum asEListPatternNodeType {
80 asEListPatternNodeType type;
92 enum asEObjVarInfoOption {
101 asTRAIT_CONSTRUCTOR = 1,
102 asTRAIT_DESTRUCTOR = 2,
105 asTRAIT_PROTECTED = 16,
107 asTRAIT_OVERRIDE = 64,
108 asTRAIT_SHARED = 128,
109 asTRAIT_EXTERNAL = 256,
110 asTRAIT_EXPLICIT = 512,
111 asTRAIT_PROPERTY = 1024
116 void SetTrait(asEFuncTrait trait,
bool set) {
117 if (
set) traits |= trait;
118 else traits &= ~trait;
120 bool GetTrait(asEFuncTrait trait)
const {
121 return (traits & trait) ? true :
false;
130 asEObjVarInfoOption option;
157 asEFuncType GetFuncType()
const;
158 const char *GetModuleName()
const;
160 const char *GetScriptSectionName()
const;
161 const char *GetConfigGroup()
const;
162 asDWORD GetAccessMask()
const;
163 void *GetAuxiliary()
const;
167 const char *GetObjectName()
const;
168 const char *GetName()
const;
169 const char *GetNamespace()
const;
170 const char *GetDeclaration(
bool includeObjectName =
true,
bool includeNamespace =
false,
bool includeParamNames =
false)
const;
171 bool IsReadOnly()
const;
172 bool IsPrivate()
const;
173 bool IsProtected()
const;
174 bool IsFinal()
const;
175 bool IsOverride()
const;
176 bool IsShared()
const;
177 bool IsExplicit()
const;
178 bool IsProperty()
const;
179 asUINT GetParamCount()
const;
180 int GetParam(asUINT index,
int *typeId, asDWORD *flags = 0,
const char **name = 0,
const char **defaultArg = 0)
const;
181 int GetReturnTypeId(asDWORD *flags = 0)
const;
184 int GetTypeId()
const;
185 bool IsCompatibleWithTypeId(
int typeId)
const;
188 void *GetDelegateObject()
const;
193 asUINT GetVarCount()
const;
194 int GetVar(asUINT index,
const char **name,
int *typeId = 0)
const;
195 const char *GetVarDecl(asUINT index,
bool includeNamespace =
false)
const;
196 int FindNextLineWithCode(
int line)
const;
199 asDWORD *GetByteCode(asUINT *length = 0);
202 void *SetUserData(
void *userData, asPWORD type);
203 void *GetUserData(asPWORD type)
const;
209 void SetShared(
bool set) {
210 traits.SetTrait(asTRAIT_SHARED,
set);
212 void SetReadOnly(
bool set) {
213 traits.SetTrait(asTRAIT_CONST,
set);
215 void SetFinal(
bool set) {
216 traits.SetTrait(asTRAIT_FINAL,
set);
218 void SetOverride(
bool set) {
219 traits.SetTrait(asTRAIT_OVERRIDE,
set);
221 void SetExplicit(
bool set) {
222 traits.SetTrait(asTRAIT_EXPLICIT,
set);
224 void SetProtected(
bool set) {
225 traits.SetTrait(asTRAIT_PROTECTED,
set);
227 void SetPrivate(
bool set) {
228 traits.SetTrait(asTRAIT_PRIVATE,
set);
230 void SetProperty(
bool set) {
231 traits.SetTrait(asTRAIT_PROPERTY,
set);
233 bool IsFactory()
const;
240 int AddRefInternal();
241 int ReleaseInternal();
243 void DestroyHalfCreated();
253 void DestroyInternal();
257 int GetSpaceNeededForArguments();
258 int GetSpaceNeededForReturnValue();
259 asCString GetDeclarationStr(
bool includeObjectName =
true,
bool includeNamespace =
false,
bool includeParamNames =
false)
const;
260 int GetLineNumber(
int programPosition,
int *sectionIdx);
261 void ComputeSignatureId();
265 bool IsSignatureExceptNameAndReturnTypeEqual(
const asCScriptFunction *fun)
const;
267 bool IsSignatureExceptNameAndObjectTypeEqual(
const asCScriptFunction *func)
const;
269 asCTypeInfo *GetTypeInfoOfLocalVar(
short varOffset);
273 int RegisterListPattern(
const char *decl,
asCScriptNode *listPattern);
276 bool DoesReturnOnStack()
const;
280 void AddReferences();
281 void ReleaseReferences();
283 void AllocateScriptFunctionData();
284 void DeallocateScriptFunctionData();
320 asEFuncType funcType;
331 void *objForDelegate;
343 asDWORD variableSpace;
352 asUINT objVariablesOnHeap;
364 asJITFunction jitFunction;
371 int scriptSectionIdx;
380 bool dontCleanUpOnException;
389 const char *
const DELEGATE_FACTORY =
"$dlgte";
Definition: as_module.h:93
Definition: angelscript.h:1083
Definition: as_typeinfo.h:64
Definition: angelscript.h:793
Definition: as_scriptfunction.h:146
Definition: as_objecttype.h:100
Definition: as_namespace.h:39
Definition: as_scriptfunction.h:133
Definition: as_scriptfunction.h:114
Definition: as_configgroup.h:50
Definition: as_scriptfunction.h:59
Definition: as_scriptfunction.h:74
Definition: as_scriptfunction.h:127
Definition: as_atomic.h:49
Definition: as_callfunc.h:99
Definition: as_datatype.h:60
Definition: as_property.h:68
Definition: as_scriptfunction.h:84
Definition: as_scriptfunction.h:338
Definition: as_typeinfo.h:292
Definition: as_scriptengine.h:64
Definition: angelscript.h:639
Definition: angelscript.h:1011
Definition: as_scriptnode.h:104
Definition: as_string.h:41