Пример #1
0
    def add(self, value, time=None):
        ''' Add the value to the set.

        :param value: The value to add to the set
        :param time: The time to add this value at
        '''
        time = time or current_time()
        self.pdata[value] = time
Пример #2
0
    def set(self, value, time=None):
        ''' Given a new value, attempt to set it in the register

        :param value: The new value to set
        :param time: The new time to compare with
        '''
        self.time = time or current_time()
        self.data = value
Пример #3
0
    def remove(self, value, time=None):
        ''' Remove the value from the set.

        :param value: The value to remove from the set
        :param time: The time to remove this value at
        '''
        assert value in self.pdata, "cannot remove a value that is not present"
        time = time or current_time()
        self.ndata[value] = time