Jump to content
  • Advertisement

ASBai

Member
  • Content count

    71
  • Joined

  • Last visited

Community Reputation

120 Neutral

About ASBai

  • Rank
    Member

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ASBai

    Add a callback for the GarbageCollect API

    Ok, I tried it, it’s really good, thank you!
  2. ASBai

    Add a callback for the GarbageCollect API

    Hi, Andreas Has this callback been added? I remember it has been added, but I didn't find it in the manual. Thanks :-)
  3. Ok,I'll send it to you by email later :-)
  4. But in the default configuration, AS_NO_EXCEPTIONS is not set and " /EHsc" also not enabled, right? I just think it may be better to either enable exception or turn on AS_NO_EXCEPTIONS by default to keep the project constantly. :-)
  5. VC2005: We are deal with the c++ exception finally. So the stack unwind facilities must be enabled for it. We can enable it by simply adding the "/EHsc" option. Of course, we can also enable it through the VC Project Property Dialog at: "C/C++ -> Code Generation -> Enable C++ Exceptions" :-)
  6. Hi Andreas, It's working fine now. Thanks!
  7. Hi @WitchLord, There seems still some problem: It's ok when I register only one iterator like: r = pENGINE->SetDefaultNamespace("cique"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); // ... r = pENGINE->SetDefaultNamespace(""); Then use it like: cique::iterator<string> p=circularQueue.begin(); // ... But if I register more iterator types in different namespace: r = pENGINE->SetDefaultNamespace("vector"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); r = pENGINE->SetDefaultNamespace(""); //... r = pENGINE->SetDefaultNamespace("deque"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); r = pENGINE->SetDefaultNamespace(""); //... r = pENGINE->SetDefaultNamespace("cique"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); r = pENGINE->SetDefaultNamespace(""); And then do the exactly same thing: cique::iterator<string> p=circularQueue.begin(); // ... The engine will emit an error this time: PS: There is no xxx:iterator<string> specification registered. Thanks :-)
  8. Well done! I'll give it a try! Thanks :-D
  9. Hi @WitchLord, I've sent you a internal message with this forum, Please check it and give me a reply at your convenience. Thanks :-)
  10. Hi, WitchLord, sorry to bother you again: I want register same iterator specializations in different namespace: r = pENGINE->SetDefaultNamespace("vector"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); r = pENGINE->RegisterObjectType("iterator<int>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS); // ... r = pENGINE->SetDefaultNamespace(""); //... r = pENGINE->SetDefaultNamespace("deque"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); r = pENGINE->RegisterObjectType("iterator<int>", sizeof(...), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS); // <--- FAILED r = pENGINE->SetDefaultNamespace(""); As above shown, when I try to register deque::iterator<int>, the engine complain: And it stopped at as_scriptengine.cpp, line 1795: // If the builder fails or the namespace is different than the default // namespace, then the type name is new and it should be registered if( r < 0 || dt.GetTypeInfo()->nameSpace != defaultNamespace ) // dt.GetTypeInfo()->nameSpace = "vector", defaultNamespace = "deque" { // Make sure the name is not a reserved keyword size_t tokenLen; int token = tok.GetToken(name, typeName.GetLength(), &tokenLen); if( token != ttIdentifier || typeName.GetLength() != tokenLen ) // <---- HERE typeName = "iterator<int>", tokenLen = 8(iterator) return ConfigError(asINVALID_NAME, "RegisterObjectType", name, 0); // ... But if I don't register vector::iterator<int>, then deque::iterator<int> will work correctly. Is this an engine bug? or it's still I doing some wrong this time? 8-| Thanks :-)
  11. ASBai

    Failed register the template specialization

    Thanks, I didn't notice that the example in the document only left the asOBJ_REF flag...
  12. I've register a template vector::iterator<T>, and try to register its specialization like: r = pENGINE->SetDefaultNamespace("vector"); r = pENGINE->RegisterObjectType("iterator<T>", sizeof(ITOR), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); // OK // ... r = pENGINE->RegisterObjectType("iterator<int>", sizeof(ITOR), asOBJ_VALUE|asOBJ_APP_CLASS_CDAK|asOBJ_APP_CLASS_ALLINTS|asOBJ_TEMPLATE); // FAILED! The engine complain: I think I'm read the document (http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_template.html#doc_adv_template_2) carefully, But still not found where did I go wrong? BTW: The engine emit the error at as_parser.cpp (line 703): // BNF:17: IDENTIFIER ::= single token: starts with letter or _, can include any letter and digit, same as in C++ asCScriptNode *asCParser::ParseIdentifier() { asCScriptNode *node = CreateNode(snIdentifier); if( node == 0 ) return 0; sToken t1; GetToken(&t1); if( t1.type != ttIdentifier ) // <---- HERE { Error(TXT_EXPECTED_IDENTIFIER, &t1); Error(InsteadFound(t1), &t1); return node; } node->SetToken(&t1); node->UpdateSourcePos(t1.pos, t1.length); return node; } Please give me some tips, thanks :-)
  13. ASBai

    Can not create a value type template

    Yeah, I noticed that. But I think we can relax this restriction when we set the asEP_ALLOW_UNSAFE_REFERENCES option to true? :-)
  14. ASBai

    asCALL_THISCALL bind work incorrectly

    Ok, I'm missing the dummy int argument, thanks :-)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!