Closed DraTeots closed 4 weeks ago
Not inconsistent actually! The PascalCase methods are public-facing, and the snake_case methods are not. The example you pasted uses non-public-facing methods because the public ones didn't exist at the time.
So how to rewrite a piece above with public API and consistent naming?
This particular code:
https://github.com/JeffersonLab/JANA4ML4FPGA/blob/main/src/executables/jana4ml4fpga/CDAQTopology.h
What about this one?
void acquire_services(JServiceLocator *) override;
Is it public-facing enough to be in every user written service?
Ok =) Found this in the source:
// This will be deprecated eventually
virtual void acquire_services(JServiceLocator*) {};
Thanks!
acquire_services()
will be replaced by Init()
, once I update eicrecon and hd_recon so as not to produce tons of deprecation warnings. However, Init() itself is less necessary because parameters and services should be injected using the Parameter<>()
and Service<>
helpers, just like JOmniFactory
. As far as I'm aware, all components now support injecting parameters and services this way. This is part of #276.
Proposal: make JANA2 API naming consistent.
I believe, as of now, the most inconsistent part is member functions naming. All major API classes have PascalCase members, but some groups of classes have every function in snake_case (e.g. Topology or Engine folders).
Whatever JANA2 is going to end with: PascalCase or snake_case doesn't matter compared to how it looks now: