Skip to content

GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua#7744

Merged
minggo merged 17 commits intococos2d:v3from
litefeel:customguireader
Sep 4, 2014
Merged

GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua#7744
minggo merged 17 commits intococos2d:v3from
litefeel:customguireader

Conversation

@litefeel
Copy link
Copy Markdown

No description provided.

@litefeel litefeel changed the title fix: copy map when getParseCallBackMap() and getParseObjectMap() GUIReader::registerTypeAndCallBack for std::function Aug 12, 2014
fix compile error
@litefeel
Copy link
Copy Markdown
Author

[ci rebuild]

2 similar comments
@darkdukey
Copy link
Copy Markdown
Contributor

[ci rebuild]

@litefeel
Copy link
Copy Markdown
Author

[ci rebuild]

@litefeel
Copy link
Copy Markdown
Author

i can build success. why not there?

@minggo
Copy link
Copy Markdown
Contributor

minggo commented Aug 14, 2014

It seems the error exist in lua-binding.

@litefeel
Copy link
Copy Markdown
Author

@minggo ?

@litefeel
Copy link
Copy Markdown
Author

@minggo i don't know.

@minggo
Copy link
Copy Markdown
Contributor

minggo commented Aug 15, 2014

The error log is http://115.28.134.83:8000/job/cocos-2dx-pull-request-build/4682/node=android_mac/console.
I will ask somebody to check it.

@minggo
Copy link
Copy Markdown
Contributor

minggo commented Aug 18, 2014

I have asked @samuele3hu to take a look.

@samuele3hu
Copy link
Copy Markdown
Contributor

It's a bug of bindings-generator,it didn't consider the value of r in 245 line of tools/bindings-generator/generatory.py.I suggest that skipping the lua bindings for this functions by setting the 'tools/tolua/cocos2dx_studio.ini'.

@minggo
Copy link
Copy Markdown
Contributor

minggo commented Aug 18, 2014

What did you mean the value of r? Will you please modify tools/tolua/cocos2dx_studio.ini?

@samuele3hu
Copy link
Copy Markdown
Contributor

En,I will check out this branch and modify it.

@minggo
Copy link
Copy Markdown
Contributor

minggo commented Aug 19, 2014

@lite3
@samuele3hu fixed lua-binding issue in #7817.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @lite3
Why should we change std::map from value to reference?
I think c++11 std::map has move semantic , it won't introduce extra copy performance penalty here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndyQue

auto map = reader->getParseCallBackMap();
  1. this map is copy, reader->_mapParseSelector. can not modify.
  2. move semantic used by temporary object. but the temporary map need malloc.

@litefeel litefeel changed the title GUIReader::registerTypeAndCallBack for std::function GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua Aug 29, 2014
@litefeel
Copy link
Copy Markdown
Author

@minggo the same problem at build failed.
fix it at cocos2d/bindings-generator#131

@samuele3hu
Copy link
Copy Markdown
Contributor

@lite3 , I check out your branch,and use the latest bindings-generator for cocos2dx_studio.ini, the result is successful.Why did you modify the bindings-generator.

@litefeel
Copy link
Copy Markdown
Author

litefeel commented Sep 1, 2014

@samuele3hu

for bindings-generator, I write it at cocos2d/bindings-generator#131

now, i write it again.

old regex: function<(.+) .*\((.*)\)>
now regex: function<(.+) *\((.*)\)>

input string is function<Ref *(void)>
result about first group:
old: Ref
now: Ref *

@litefeel
Copy link
Copy Markdown
Author

litefeel commented Sep 3, 2014

@minggo please review

@minggo
Copy link
Copy Markdown
Contributor

minggo commented Sep 3, 2014

Ok, i have asked @samuele3hu to review lua-binding codes.
Thanks.

@samuele3hu
Copy link
Copy Markdown
Contributor

@lite3,you are right.If use function<(.+) .*\((.*)\)>,the parse error about ret_type was triggered,through it don't have effect now,thanks.
@minggo , for lua-binding codes,i think it is ok.

minggo pushed a commit that referenced this pull request Sep 4, 2014
GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua
@minggo minggo merged commit 99f3b37 into cocos2d:v3 Sep 4, 2014
cocos-travis-mac pushed a commit to cocos-travis-mac/cocos2d-x that referenced this pull request Sep 4, 2014
GUIReader::registerTypeAndCallBack for std::function and add CustomGUIReader for lua
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants