Skip to content

[Feature]: Ensure that objects are actually retrieved from the configuration #261

@eflumerf

Description

@eflumerf

Description

In many SmartDaqApplication implementations, Queue Descriptor and Network Descriptor inputs are matched against what the application expects, with pointers to the expected descriptors being then used to create the connection objects that the application needs.

e.g.

const QueueDescriptor* fa_output_qdesc = nullptr;

for (auto rule : get_queue_rules()) {
  auto destination_class = rule->get_destination_class();
  if (destination_class == "FragmentAggregatorModule") {
    fa_output_qdesc = rule->get_descriptor();
  }
}

Whenever an object is retrieved from the configuration with a pattern like this, the pointer should be checked and a BadConf exception thrown if it is still nullptr. This prevents segmentation faults that are much harder to diagnose than a mismatch of configuration objects.

Potential impact radius

Small/Isolated

Reason for change

No response

Suggested implementations

No response

Testing suggestions

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions