Skip to content

FairRootManager->RegisterAny(...) doesn't find dictionary for std::vector<T> if using std::shared_ptr #1186

@KlewinS

Description

@KlewinS

as requested by @sawenzel this issue is moved from FairRoot (FairRootGroup/FairRoot#789) to O2.

Somehow the dictionary of std::vector<o2::TPC::ClusterHardwareContainer8kb> is not found at runtime if using std::shared_ptr<std::vector<T>> instead of a plain pointer.

It makes it even more strange that if the corresponding LinkDef.h contains the correct pragma statement for std::vector, then the dictionary is not even found for the plain pointer.

The current workaround which seems to work at the moment for me is to remove the std::vector pragma statement from the LinkDef.h and register first a plain pointer of the vector via RegisterAny() and afterwards the pointer of interest of the shared_ptr via the already known workaround with the static auto tmpPtr = container.get(); (https://github.com/KlewinS/AliceO2/blob/da1987c06651391c4246f7f0963fffd1ce320d52/Detectors/TPC/reconstruction/src/ClustererTask.cxx#L90)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions