Access component defined in yaml from custom C++ app

I’m wondering if it’s possible to access a component defined in the yaml file from a custom C++ application, e.g.

my_device.yaml:

esphome:
  ...
  includes:
    - my_app.hpp
dallas:
  - pin: 22

my_app.hpp:

class MyApp : public PollingComponent
{
  ...
  void update() override
  {
    // read the dallas sensor at pin 22
    ???
  }
};