Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4f352c35 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Store a pointer to PhyLayerFactory"

parents a4243e7b 993e83c5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@ std::shared_ptr<PhyLayer> PhyLayerFactory::GetPhyLayer(
        device_receive,
    uint32_t device_id) {
  std::shared_ptr<PhyLayer> new_phy = std::make_shared<PhyLayerImpl>(
      phy_type_, next_id_++, device_receive, device_id,
      std::shared_ptr<PhyLayerFactory>(this));
      phy_type_, next_id_++, device_receive, device_id, this);
  phy_layers_.push_back(new_phy);
  return new_phy;
}
@@ -113,7 +112,7 @@ PhyLayerImpl::PhyLayerImpl(
    Phy::Type phy_type, uint32_t id,
    const std::function<void(model::packets::LinkLayerPacketView)>&
        device_receive,
    uint32_t device_id, const std::shared_ptr<PhyLayerFactory> factory)
    uint32_t device_id, PhyLayerFactory* factory)
    : PhyLayer(phy_type, id, device_receive, device_id), factory_(factory) {}

PhyLayerImpl::~PhyLayerImpl() {
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ class PhyLayerImpl : public PhyLayer {
  PhyLayerImpl(Phy::Type phy_type, uint32_t id,
               const std::function<void(model::packets::LinkLayerPacketView)>&
                   device_receive,
               uint32_t device_id, std::shared_ptr<PhyLayerFactory> factory);
               uint32_t device_id, PhyLayerFactory* factory);
  ~PhyLayerImpl() override;

  void Send(
@@ -81,6 +81,6 @@ class PhyLayerImpl : public PhyLayer {


 private:
  std::shared_ptr<PhyLayerFactory> factory_;
  PhyLayerFactory* factory_;
};
}  // namespace test_vendor_lib