def __init__(self, sig: SimSignal, fn, shouldBeEnabledFn):
assert not isinstance(fn, CallbackLoop)<EOL>self.fn = fn<EOL>self.isGenerator = inspect.isgeneratorfunction(fn)<EOL>self.shouldBeEnabledFn = shouldBeEnabledFn<EOL>self._callbackIndex = None<EOL>try:<EOL><INDENT>self.sig = sig._sigInside<EOL><DEDENT>except AttributeError:<EOL><INDENT>self.sig = sig<EOL><DEDENT>
:param sig: signal on which write callback should be used
:attention: if condFn is None callback function is always executed

:ivra fn: function/generator which is callback which should be executed
:ivar isGenerator: flag if callback function is generator
    or normal function
:ivar _callbackIndex: index of callback in write callbacks on sig,
    if is None callback was not registered yet
:ivar shouldBeEnabledFn: function() -> bool, which returns True if this
    callback loop should be enabled