C++11 transition
Opened this issue · 5 comments
- Ability to compile OpenSDN parts using C++11 standard of language
- Elemination of old (deprectated) constructions: auto_ptr, NULL, etc
Requires:
- Update log4cplus to the newer version (because the older one uses auto_ptr): setLayout
- Refactoring of contrail-common/database (gen_if.cc, cql_if.cc,etc), since it uses boost::bind, which is not compatible with std::unique_ptr
With the next commits the code compiles w/o errors with the key -std=c++11 and auto_ptr class usage has been removed from the generated sources:
https://gerrit.opensdn.io/c/opensdn-io/tf-build/+/530
https://gerrit.opensdn.io/c/opensdn-io/tf-controller/+/540
https://gerrit.opensdn.io/c/opensdn-io/tf-common/+/539
https://gerrit.opensdn.io/c/opensdn-io/tf-analytics/+/538
https://gerrit.opensdn.io/c/opensdn-io/tf-controller/+/556
https://gerrit.opensdn.io/c/opensdn-io/tf-api-client/+/554
Nice. Do we have a full list of what remains to be done to complete this?
There are several new commits, that have already passed CI/CD:
- https://gerrit.opensdn.io/c/opensdn-io/tf-controller/+/612
- https://gerrit.opensdn.io/c/opensdn-io/tf-common/+/610
- https://gerrit.opensdn.io/c/opensdn-io/tf-api-client/+/611
- https://gerrit.opensdn.io/c/opensdn-io/tf-analytics/+/613
Now I have to verify them on my test facility.
To accomplish all work, next steps are neccesary:
- update of log4cplus library to newer versions that use unique_ptr instead of auto_ptr;
- refactoring of contrail-common/database (this is large amount of work and it can be done later);
- testing of new code on OpenStack installations (with at least 2 hypervisors).
Updates?
I introduced a newer version of log4cplus C++ library into the build container and updated all the code that uses log4cplus: https://gerrit.opensdn.io/c/opensdn-io/tf-controller/+/675
There is still one unit test that sometime work and sometime - not. I'm concentrating on it not.
To make OpenSDN fully C++11 comliant, it's neccesary to refactor CQL database driver, but I don't think I can accomplish this before the first release. So, I would say, nowadays we are 95% C++ compliant.