cms-gem-daq-project / xhal

XHAL interface library
0 stars 10 forks source link

Implement new (de)serializers for the RPC calls #144

Closed lpetre-ulb closed 4 years ago

lpetre-ulb commented 4 years ago

Description

This PR mainly introduces default new type (de)serializers for the templated RPC calls. In order to fix #138, the following additional types are now supported:

To get the best support, split (de)serializers can now be created with the names save and load. Please refer to the documentation and commit message for more information.

Compilation has also been fixed. Previously, the xDAQ headers for the DAQ machine were searched for during compilation for the CTP7, leading to un-resolvable symbols at run-time.

Types of changes

Motivation and Context

See https://github.com/cms-gem-daq-project/xhal/issues/138; used in https://github.com/cms-gem-daq-project/ctp7_modules/pull/169.

How Has This Been Tested?

Works with https://github.com/cms-gem-daq-project/ctp7_modules/pull/169. More thorough tests should be perform in the future.

Checklist:

lpetre-ulb commented 4 years ago

In addition to some nitpicking, I'd like to see a clear test plan for float since it's not covered by getVFAT3ChipIDs.

I would have liked to write a test suite, but I have no idea how to build it... If one write the following RPC method:

void vfat3::logFloats::operator()(const std::vector<float> &value) const
{
  for (const auto& i : value)
    LOG4CPLUS_WARN(logger, i);
}

and trivially calls it within the templated RPC framework: xhal::common::rpc::call<vfat3::logFloats>(conn, std::vector<float>{3.14, 42.42});, the log output fully matches the expectations:

Mar 11 08:54:51 CTP7 user.warn rpcsvc: eagle48[9449] - void vfat3::logFloats::operator()(const std::vector<float>&) const - 3.14
Mar 11 08:54:51 CTP7 user.warn rpcsvc: eagle48[9449] - void vfat3::logFloats::operator()(const std::vector<float>&) const - 42.42

(Notice that it also test std::vector<T>.)

lpetre-ulb commented 4 years ago

All comments should have been addressed.