|
|
@@ -41,11 +41,11 @@ namespace ASBindingGenerator
|
|
|
static void RegisterObjectType(const ClassAnalyzer& classAnalyzer, ProcessedClass& inoutProcessedClass)
|
|
|
{
|
|
|
string className = classAnalyzer.GetClassName();
|
|
|
- bool isFakeRef = classAnalyzer.IsFakeRef();
|
|
|
- if (classAnalyzer.IsRefCounted() || isFakeRef)
|
|
|
+ bool isNoCount = classAnalyzer.IsNoCount();
|
|
|
+ if (classAnalyzer.IsRefCounted() || isNoCount)
|
|
|
{
|
|
|
inoutProcessedClass.objectTypeRegistration_ = "engine->RegisterObjectType(\"" + className + "\", 0, asOBJ_REF" +
|
|
|
- (isFakeRef ? " | asOBJ_NOCOUNT" : "") + ");";
|
|
|
+ (isNoCount ? " | asOBJ_NOCOUNT" : "") + ");";
|
|
|
}
|
|
|
else // Value type
|
|
|
{
|
|
|
@@ -70,7 +70,7 @@ static bool IsConstructorRequired(const ClassAnalyzer& classAnalyzer)
|
|
|
if (classAnalyzer.IsRefCounted())
|
|
|
return false;
|
|
|
|
|
|
- if (classAnalyzer.IsFakeRef())
|
|
|
+ if (classAnalyzer.IsNoCount())
|
|
|
return false;
|
|
|
|
|
|
if (classAnalyzer.IsPod())
|
|
|
@@ -84,7 +84,7 @@ static bool IsDestructorRequired(const ClassAnalyzer& classAnalyzer)
|
|
|
if (classAnalyzer.IsRefCounted())
|
|
|
return false;
|
|
|
|
|
|
- if (classAnalyzer.IsFakeRef())
|
|
|
+ if (classAnalyzer.IsNoCount())
|
|
|
return false;
|
|
|
|
|
|
if (classAnalyzer.IsPod())
|
|
|
@@ -152,13 +152,13 @@ static void RegisterConstructor(const MethodAnalyzer& methodAnalyzer, ProcessedC
|
|
|
string cppClassName = classAnalyzer.GetClassName();
|
|
|
vector<ParamAnalyzer> params = methodAnalyzer.GetParams();
|
|
|
|
|
|
- bool isFakeRef = classAnalyzer.IsFakeRef();
|
|
|
+ bool isNoCount = classAnalyzer.IsNoCount();
|
|
|
|
|
|
if (params.empty()) // Default constructor
|
|
|
{
|
|
|
- if (classAnalyzer.IsRefCounted() || isFakeRef)
|
|
|
+ if (classAnalyzer.IsRefCounted() || isNoCount)
|
|
|
result.registration_ = "engine->RegisterObjectBehaviour(\"" + asClassName + "\", asBEHAVE_FACTORY, \"" +
|
|
|
- asClassName + "@" + (isFakeRef ? "" : "+") +
|
|
|
+ asClassName + "@" + (isNoCount ? "" : "+") +
|
|
|
" f()\", asFUNCTION(ASCompatibleFactory<" + cppClassName + ">), AS_CALL_CDECL);";
|
|
|
else
|
|
|
result.registration_ = "engine->RegisterObjectBehaviour(\"" + asClassName + "\", asBEHAVE_CONSTRUCT, \"void f()\", asFUNCTION(ASCompatibleConstructor<" + cppClassName + ">), AS_CALL_CDECL_OBJFIRST);";
|
|
|
@@ -198,9 +198,9 @@ static void RegisterConstructor(const MethodAnalyzer& methodAnalyzer, ProcessedC
|
|
|
needWrapper = true;
|
|
|
}
|
|
|
|
|
|
- if (classAnalyzer.IsRefCounted() || classAnalyzer.IsFakeRef())
|
|
|
+ if (classAnalyzer.IsRefCounted() || isNoCount)
|
|
|
{
|
|
|
- string asDeclaration = asClassName + "@" + (isFakeRef ? "" : "+") + " f(" + JoinASDeclarations(convertedParams) + ")";
|
|
|
+ string asDeclaration = asClassName + "@" + (isNoCount ? "" : "+") + " f(" + JoinASDeclarations(convertedParams) + ")";
|
|
|
result.registration_ = result.registration_ =
|
|
|
"engine->RegisterObjectBehaviour(\"" + asClassName + "\", asBEHAVE_FACTORY, \"" + asDeclaration + "\", AS_FUNCTION("
|
|
|
+ GenerateWrapperName(methodAnalyzer) + ") , AS_CALL_CDECL);";
|
|
|
@@ -224,7 +224,7 @@ static void RegisterDestructor(const ClassAnalyzer& classAnalyzer, ProcessedClas
|
|
|
if (classAnalyzer.IsRefCounted())
|
|
|
return;
|
|
|
|
|
|
- if (classAnalyzer.IsFakeRef())
|
|
|
+ if (classAnalyzer.IsNoCount())
|
|
|
return;
|
|
|
|
|
|
string className = classAnalyzer.GetClassName();
|
|
|
@@ -1300,9 +1300,9 @@ static void ProcessClass(const ClassAnalyzer& classAnalyzer)
|
|
|
processedClass.hiddenFields_ = classAnalyzer.GetHiddenFields();
|
|
|
processedClass.hiddenStaticFields_ = classAnalyzer.GetHiddenStaticFields();*/
|
|
|
|
|
|
- bool isFakeRef = classAnalyzer.IsFakeRef();
|
|
|
+ bool isNoCount = classAnalyzer.IsNoCount();
|
|
|
|
|
|
- if (classAnalyzer.IsAbstract() && !(classAnalyzer.IsRefCounted() || isFakeRef))
|
|
|
+ if (classAnalyzer.IsAbstract() && !(classAnalyzer.IsRefCounted() || isNoCount))
|
|
|
{
|
|
|
processedClass.objectTypeRegistration_ = "// Not registered because value types can not be abstract";
|
|
|
processedClass.noBind_ = true;
|
|
|
@@ -1330,12 +1330,12 @@ static void ProcessClass(const ClassAnalyzer& classAnalyzer)
|
|
|
|
|
|
RegisterObjectType(classAnalyzer, processedClass);
|
|
|
|
|
|
- if (classAnalyzer.IsRefCounted() || isFakeRef)
|
|
|
+ if (classAnalyzer.IsRefCounted() || isNoCount)
|
|
|
{
|
|
|
vector<ClassAnalyzer> baseClasses = classAnalyzer.GetAllBaseClasses();
|
|
|
for (ClassAnalyzer baseClass : baseClasses)
|
|
|
{
|
|
|
- if (baseClass.IsRefCounted() || baseClass.IsFakeRef())
|
|
|
+ if (baseClass.IsRefCounted() || baseClass.IsNoCount())
|
|
|
{
|
|
|
string cppBaseClassName = baseClass.GetClassName();
|
|
|
string asBaseClassName = cppBaseClassName;
|
|
|
@@ -1368,9 +1368,9 @@ static void ProcessClass(const ClassAnalyzer& classAnalyzer)
|
|
|
string cppClassName = classAnalyzer.GetClassName();
|
|
|
string asClassName = classAnalyzer.GetClassName();
|
|
|
|
|
|
- if (classAnalyzer.IsRefCounted() || isFakeRef)
|
|
|
+ if (classAnalyzer.IsRefCounted() || isNoCount)
|
|
|
result->registration_ = "engine->RegisterObjectBehaviour(\"" + asClassName + "\", asBEHAVE_FACTORY, \"" +
|
|
|
- asClassName + "@" + (isFakeRef ? "" : "+") + " f()\", asFUNCTION(ASCompatibleFactory<" + cppClassName + ">), AS_CALL_CDECL);";
|
|
|
+ asClassName + "@" + (isNoCount ? "" : "+") + " f()\", asFUNCTION(ASCompatibleFactory<" + cppClassName + ">), AS_CALL_CDECL);";
|
|
|
else
|
|
|
result->registration_ = "engine->RegisterObjectBehaviour(\"" + asClassName + "\", asBEHAVE_CONSTRUCT, \"void f()\", asFUNCTION(ASCompatibleConstructor<" + cppClassName + ">), AS_CALL_CDECL_OBJFIRST);";
|
|
|
|