(ctx_or_type, default_serialization_type: str)
| 38 | |
| 39 | |
| 40 | def _CreateContextRef(ctx_or_type, default_serialization_type: str) -> aimrt_python_runtime.ContextRef: |
| 41 | if isinstance(ctx_or_type, aimrt_python_runtime.Context): |
| 42 | ctx_ref = aimrt_python_runtime.ContextRef(ctx_or_type) |
| 43 | elif isinstance(ctx_or_type, aimrt_python_runtime.ContextRef): |
| 44 | ctx_ref = ctx_or_type |
| 45 | else: |
| 46 | serialization_type = ctx_or_type if isinstance(ctx_or_type, str) else default_serialization_type |
| 47 | ctx = aimrt_python_runtime.Context() |
| 48 | ctx.SetSerializationType(serialization_type) |
| 49 | ctx_ref = aimrt_python_runtime.ContextRef(ctx) |
| 50 | |
| 51 | if ctx_ref.GetSerializationType() == "": |
| 52 | ctx_ref.SetSerializationType(default_serialization_type) |
| 53 | |
| 54 | return ctx_ref |
| 55 | |
| 56 | |
| 57 | def GetRos2MessageTypeName(msg_type: Ros2MsgType) -> str: |
no test coverage detected