This repository was archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
Command parser #103
Merged
Merged
Command parser #103
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
parameter/ParameterMgr.cpp
Outdated
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
further enhancement: only instantiate it if/when the remote interface is needed (e.g. don't create it if TuningAllowed=false).
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ParameterMgr is offered as template parser to the RemoteCommandHandlerTemplate class. This is not his primary job and make the class hard to read. This patch introduces the CommandParser class which handle this job. Signed-off-by: Jules Clero <julesx.clero@intel.com>
Signed-off-by: Jules Clero <julesx.clero@intel.com>
This typedef is already defined in RemoteCommandHandlerTemplate class. As we include its header, we can use it directly. Signed-off-by: Jules Clero <julesx.clero@intel.com>
9dba49b to
f8ac041
Compare
parameter/ParameterMgr.cpp
Outdated
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See clero@8ad588b#commitcomment-11721629
(+ coding style: add a space after if)
Remote commands was organised through a vector and browsed many times. This patch introduces the use of a map to use only one command structure and to enhance browsing. Signed-off-by: Jules Clero <julesx.clero@intel.com>
Parsing data for remote command are always loaded even when the tuning is not allowed. This patch optimizes the memory handling by avoiding the command parser's load when the tuning is not allowed. Signed-off-by: Jules Clero <julesx.clero@intel.com>
There is no need of using a pointer. Signed-off-by: Jules Clero <julesx.clero@intel.com>
As RemoteCommandHandlerTemplate has been almost completely rewritten, the entire file has been commented and modified to follow new coding style rules. Signed-off-by: Jules Clero <julesx.clero@intel.com>
Some headers in TestPlatorm implementation was present but unused, this patch removes them. Signed-off-by: Jules Clero <julesx.clero@intel.com>
Signed-off-by: Jules Clero <julesx.clero@intel.com>
RemoteCommandHandler was using old style function pointer to keep commands. This patch introduces the use of function object. The help command is now handled as any other commands thanks to partial function definition. Signed-off-by: Jules Clero <julesx.clero@intel.com>
Previous name was not clear as the help of a command can be many thing. This patch renames it 'argument description' as it describe exactly what we are waiting. Signed-off-by: Jules Clero <julesx.clero@intel.com>
Signed-off-by: Jules Clero <julesx.clero@intel.com>
Signed-off-by: Jules Clero <julesx.clero@intel.com>
dawagner
added a commit
that referenced
this pull request
Jun 17, 2015
Delegate remote command parsing ParameterMgr had many responsibilities. For example, it was in charge of the remote commands' parsing. This group of patch is reworking the command parsing handling. The parsing is now handled by a dedicated class. It avoids to load remote commands parsing structure if the tuning mode is not allowed. As test-platform was doing the same work for its commands, a dedicated class has also been created for it.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Delegate remote command parsing
ParameterMgr had many responsibilities. For example, it was in charge of
the remote commands' parsing.
This group of patch is reworking the command parsing handling. The parsing is
now handled by a dedicated class. It avoids to load remote commands parsing structure
if the tuning mode is not allowed.
As test-platform was doing the same work for its commands, a dedicated class has also been
created for it.