Skip to content

Removing const from the recent getRelatedToMaxWeightAndObject methods #203

@dudarboh

Description

@dudarboh

Could we remove const from the returned EVENT::LCObject*? I.e. change

std::tuple<float, const EVENT::LCObject*> getRelatedToMaxWeightAndObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{

const EVENT::LCObject* getRelatedToMaxWeightObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{

const EVENT::LCObject* getRelatedFromMaxWeightObject(EVENT::LCObject* to, DecodeF&& decode = identity ) const{

to

 std::tuple<float, EVENT::LCObject*> getRelatedToMaxWeightAndObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{ 
 EVENT::LCObject* getRelatedToMaxWeightObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{ 
 EVENT::LCObject* getRelatedFromMaxWeightObject(EVENT::LCObject* to, DecodeF&& decode = identity ) const{ 

Before these methods one previously used getRelatedToObjects() / getRelatedFromObjects() which returned const std::vector<EVENT::LCObject*>. Objects were not const.

Could we keep things consistent with the previous usage and keep it non-const?
Otherwise, I have to change my all functions to using e.g const MCParticle* instead of MCParticle* or copy object behind the pointer...

EVENT::LCCollection::getElementAt() gets objects from collection also without const.

And we have impl classes with setters, so const is somewhat redundant here if I am not missing anything...

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