Add owner field to connection instances
This commit is contained in:
@@ -68,6 +68,7 @@ def upgrade_connection(rconn: Connection) -> Connection:
|
||||
'cdr',
|
||||
LATCH if rconn.ext.latching else '',
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
||||
|
||||
@@ -94,6 +95,7 @@ def downgrade_connection(rconn: Connection) -> Connection:
|
||||
None,
|
||||
int('durability: 1' in rconn.ext.offered_qos_profiles),
|
||||
),
|
||||
None,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ class Connection(NamedTuple):
|
||||
md5sum: str
|
||||
msgcount: int
|
||||
ext: Union[ConnectionExtRosbag1, ConnectionExtRosbag2]
|
||||
owner: object
|
||||
|
||||
|
||||
class TopicInfo(NamedTuple):
|
||||
|
||||
@@ -408,7 +408,7 @@ class Reader:
|
||||
self.connections[cid] = Connection(
|
||||
*connection[0:5],
|
||||
len(self.indexes[cid]),
|
||||
connection[6],
|
||||
*connection[6:],
|
||||
)
|
||||
except ReaderError:
|
||||
self.close()
|
||||
@@ -488,6 +488,7 @@ class Reader:
|
||||
callerid,
|
||||
latching,
|
||||
),
|
||||
self,
|
||||
)
|
||||
|
||||
def read_chunk_info(self) -> ChunkInfo:
|
||||
|
||||
@@ -255,6 +255,7 @@ class Writer:
|
||||
callerid,
|
||||
latching,
|
||||
),
|
||||
self,
|
||||
)
|
||||
|
||||
if any(x[1:] == connection[1:] for x in self.connections.values()):
|
||||
|
||||
@@ -148,6 +148,7 @@ class Reader:
|
||||
serialization_format=x['topic_metadata']['serialization_format'],
|
||||
offered_qos_profiles=x['topic_metadata'].get('offered_qos_profiles', ''),
|
||||
),
|
||||
owner=self,
|
||||
) for idx, x in enumerate(self.metadata['topics_with_message_count'])
|
||||
}
|
||||
noncdr = {
|
||||
|
||||
@@ -162,6 +162,7 @@ class Writer: # pylint: disable=too-many-instance-attributes
|
||||
serialization_format=serialization_format,
|
||||
offered_qos_profiles=offered_qos_profiles,
|
||||
),
|
||||
owner=self,
|
||||
)
|
||||
for conn in self.connections.values():
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user