getSystemState method

Future<SystemState> getSystemState ()
inherited

Retrieve list representation of system state (i.e. publishers, subscribers, and services).

Returns the information in the following format System state is in list representation [publishers, subscribers, services] publishers is of the form [ [topic1, [topic1Publisher1...topic1PublisherN]] ... ] subscribers is of the form [ [topic1, [topic1Subscriber1...topic1SubscriberN]] ... ] services is of the form [ [service1, [service1Provider1...service1ProviderN]] ... ]

Implementation

Future<SystemState> getSystemState() async {
  final resp = await _call('getSystemState', [nodeName]);
  return SystemState(
    [
      for (final pubInfo in resp[0])
        PublisherInfo(pubInfo[0] as String, pubInfo[1] as List<String>)
    ],
    [
      for (final subInfo in resp[1])
        SubscriberInfo(subInfo[0] as String, subInfo[1] as List<String>)
    ],
    [
      for (final servInfo in resp[2])
        ServiceInfo(servInfo[0] as String, servInfo[1] as List<String>)
    ],
  );
}