Project

General

Profile

Cleanup #14202

the method 'Message::decode_message' is too long

Added by yu qi about 8 years ago. Updated over 7 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

Description

hi, the method 'Message::decode_message' contains hundreds of switch-case statements, it's horribe.
i have found a elegant solution to resolve the problem.
the hundreds of switch-case statment will be reduced by a self-register factory, and it will just lead very few modify.
here is my self-register factory: https://github.com/qicosmos/cosmos/tree/master/self-register-factory

the benifits is:
1.every inherited Message classes are just need added an extra micro just like 'REGISTER_MESSAGE(Message1, "message1");' outside the class, no need to modify the original code.
2.reduce all long switch-case statements, shortcut, easy maintenance.

History

#1 Updated by Greg Farnum about 8 years ago

Can you submit that branch as a PR for review on github?

#2 Updated by yu qi about 8 years ago

Greg Farnum wrote:

Can you submit that branch as a PR for review on github?

yes, of course, i'll submit a PR in one month. Thanks for your reply.

#3 Updated by Loïc Dachary about 8 years ago

  • Target version deleted (v9.2.1)

#4 Updated by Kefu Chai about 8 years ago

  • Category deleted (cephx)
  • Status changed from New to In Progress
  • Assignee changed from Haomai Wang to yu qi

#5 Updated by Rishabh Kumar over 7 years ago

Hi,Is this issue still open? I wish to take this up if someone else is not working on it.

#6 Updated by yu qi over 7 years ago

Rishabh Kumar wrote:

Hi,Is this issue still open? I wish to take this up if someone else is not working on it.

Hi, you can close this issue.

Also available in: Atom PDF