Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[orchagent]: Remove the global variable gPortsOrch in orch.cpp file #366

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

stcheng
Copy link
Contributor

@stcheng stcheng commented Nov 1, 2017

This change is the first step of refactoring Orch class.
The global variable gPortsOrch is removed from that orch.cpp file
and this class no longer requires such external variable.

The current solution is to move the global variable into each different
places that need this variable. Later, a better design could be
introduced to further remove all the global variables from the whole
project.

Signed-off-by: Shu0T1an ChenG shuche@microsoft.com

What I did
Remove the gPortsOrch from the orch.cpp file.

Why I did it
Free the orch.cpp file.

How I verified it
Compile and run the code.

This change is the first step of refactoring Orch class.
The global variable gPortsOrch is removed from that orch.cpp file
and this class no longer requires such external variable.

The current solution is to move the global variable into each different
places that need this variable. Later, a better design could be
introduced to further remove all the global variables from the whole
project.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
@stcheng stcheng requested a review from lguohan November 1, 2017 22:19
@stcheng
Copy link
Contributor Author

stcheng commented Nov 1, 2017

@JipanYanga could you check this pull request? thanks.

@jipanyang
Copy link
Contributor

@stcheng As the first step of eliminating global variables from Orch class, the change looks good to me.
We should come up the new design asap. With "gPortsOrch->isInitDone()" check in more places,
it is a little like the spread of germs.

@stcheng stcheng merged commit 136621b into sonic-net:master Nov 2, 2017
@stcheng stcheng deleted the portsorch branch November 2, 2017 07:09
@andriymoroz-mlnx
Copy link
Contributor

If global variable gPortsOrch is removed from orch.cpp, why
extern PortsOrch *gPortsOrch;
is still there? ;)

@stcheng
Copy link
Contributor Author

stcheng commented Nov 2, 2017

@andriymoroz-mlnx ah thanks, i'll remove it.

EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
oleksandrivantsiv pushed a commit to oleksandrivantsiv/sonic-swss that referenced this pull request Mar 1, 2023
* Add VS support for setting stats via redis DB channel

* Remove SET description
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.

4 participants