| 402 | namespace sdbus { |
| 403 | |
| 404 | std::unique_ptr<IObject> createObject(IConnection& connection, ObjectPath objectPath) |
| 405 | { |
| 406 | auto* sdbusConnection = dynamic_cast<internal::IConnection*>(&connection); |
| 407 | SDBUS_THROW_ERROR_IF(!sdbusConnection, "Connection is not a real sdbus-c++ connection", EINVAL); |
| 408 | |
| 409 | return std::make_unique<internal::Object>(*sdbusConnection, std::move(objectPath)); |
| 410 | } |
| 411 | |
| 412 | } // namespace sdbus |