add route statisticsCallback

This commit is contained in:
Bastian Schroll 2019-10-25 13:29:26 +02:00
parent 341f05d25a
commit d40432e5b8
No known key found for this signature in database
GPG key ID: 0AE96912A20E9F5F

View file

@ -18,14 +18,16 @@
class Route:
"""!Class for single routing points"""
def __init__(self, name, callback):
def __init__(self, name, callback, statsCallback=None):
"""!Create a instance of an route point
@param name: name of the route point
@param callback: instance of the callback function
@param statsCallback: instance of the callback to get statistics (None)
"""
self._name = name
self._callback = callback
self._statsCallback = statsCallback
@property
def name(self):
@ -36,3 +38,8 @@ class Route:
def callback(self):
"""!Porperty to get the callback function instance"""
return self._callback
@property
def statistics(self):
"""!Porperty to get the statistics from instance"""
return self._statsCallback