Browse Source

getAllOfType

David Rose 23 years ago
parent
commit
d5feca8fe3
1 changed files with 9 additions and 0 deletions
  1. 9 0
      direct/src/distributed/ClientRepository.py

+ 9 - 0
direct/src/distributed/ClientRepository.py

@@ -644,3 +644,12 @@ class ClientRepository(DirectObject.DirectObject):
             self.notify.info('*** RESTORING SIMULATED PULLED-NETWORK-PLUG ***')
             self.tcpConn = self.hijackedTcpConn
             del self.hijackedTcpConn
+
+    def getAllOfType(self, type):
+        # Returns a list of all DistributedObjects in the repository
+        # of a particular type.
+        result = []
+        for obj in self.doId2do.values():
+            if isinstance(obj, type):
+                result.append(obj)
+        return result