)]}'
{
  "commit": "819898f523b1307bb2c11b3318181b4edc974623",
  "tree": "88898f773e80e2a9c7d0860e72e5aae3f950cab4",
  "parents": [
    "36e2228e9cd0eaedb3ac67a4152728edbed61752"
  ],
  "author": {
    "name": "Andrew Jeffery",
    "email": "andrew@codeconstruct.com.au",
    "time": "Tue May 14 14:40:01 2024 +0930"
  },
  "committer": {
    "name": "Hao Jiang",
    "email": "jianghao@google.com",
    "time": "Tue Jul 07 15:47:18 2026 -0700"
  },
  "message": "NVMeDevice: Clean up lambdas and lifetimes\n\nsetupMctpDevice() implemented the MctpEndpoint::subscribe() callbacks\nentirely with in-line lambda functions.\n\nGeneral consensus is that long and/or complex lambdas are not\ndesirable[1].\n\nGiven that we\u0027re only going to add to the complexity to mitigate MCTP\nendpoint recovery event cycles, unpick the lambdas by refactoring them\nto call back into private methods of NVMeDevice.\n\nTogether with untangling the lambda implementations, we can\nsignificantly simplify the captures. We make NVMeDevice inherit\nstd::enable_shared_from_this, after which the lambdas only require a\nweak pointer to NVMeDevice.\n\nFrom there we provide the usual NVMeDevice::create() overloads to\nrequire its instantion be wrapped in a std::shared_ptr.\n\n[1]: https://github.com/openbmc/docs/blob/master/anti-patterns.md#very-long-lambda-callbacks\n\nChange-Id: I53574da34448355eff0aea18cda744dc72e20849\nSigned-off-by: Andrew Jeffery \u003candrew@codeconstruct.com.au\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6120b3f9a6d47bf13aee7ac48962b56087c84a71",
      "old_mode": 33188,
      "old_path": "src/NVMeDevice.cpp",
      "new_id": "ce2d24d5a74a2b63d47afe77169fe8e052df51e0",
      "new_mode": 33188,
      "new_path": "src/NVMeDevice.cpp"
    },
    {
      "type": "modify",
      "old_id": "a1a0a245d48f86801c4fa6150c0c355e01b3a4f0",
      "old_mode": 33188,
      "old_path": "src/NVMeDevice.hpp",
      "new_id": "4efcbc4bd9eef3d88964f132b322d71f257617ee",
      "new_mode": 33188,
      "new_path": "src/NVMeDevice.hpp"
    },
    {
      "type": "modify",
      "old_id": "7dec543e7b328cd1cb84d4b5f690018150094890",
      "old_mode": 33188,
      "old_path": "src/NVMeSensorMain.cpp",
      "new_id": "235757378ba4711fe0064b6b0ded4efd11caf579",
      "new_mode": 33188,
      "new_path": "src/NVMeSensorMain.cpp"
    }
  ]
}
