Esempio n. 1
0
    def is_in_flush(self, store_op):
        """
        Override from :class:`FlushBase`.

        :param store_op: Store operation to check.
        :return: True if store is in flush, false otherwise.
        :rtype: bool
        """
        if range_cmp(store_op, self) == 0:
            return True
        else:
            return False
Esempio n. 2
0
    def is_in_flush(self, store_op):
        """
        Override from :class:`FlushBase`.

        :param store_op: Store operation to check.
        :return: True if store is in flush, false otherwise.
        :rtype: bool
        """
        if range_cmp(store_op, self) == 0:
            return True
        else:
            return False
Esempio n. 3
0
    def do_store(self, store_op):
        """
        Perform a store to the given file.

        The file is chosen based on the address and size
        of the store.

        :param store_op: The store operation to be performed.
        :type store_op: Store
        :return: None
        :raises: Generic exception - to be precised later.
        """
        store_ok = False
        for bf in self._files:
            if utils.range_cmp(store_op, bf) == 0:
                bf.do_store(store_op)
                store_ok = True
        if not store_ok:
            raise OSError("No suitable file found for store {}".format(store_op))
Esempio n. 4
0
    def do_revert(self, store_op):
        """
        Reverts a store made to a file.

        Performing a revert on a store that has not been made
        previously yields undefined behavior.

        :param store_op: The store to be reverted.
        :type store_op: Store
        :return: None
        :raises: Generic exception - to be precised later.
        """
        revert_ok = False
        for bf in self._files:
            if utils.range_cmp(store_op, bf) == 0:
                bf.do_revert(store_op)
                revert_ok = True
        if not revert_ok:
            raise OSError("No suitable file found for store {}".format(store_op))
Esempio n. 5
0
    def do_store(self, store_op):
        """
        Perform a store to the given file.

        The file is chosen based on the address and size
        of the store.

        :param store_op: The store operation to be performed.
        :type store_op: Store
        :return: None
        :raises: Generic exception - to be precised later.
        """
        store_ok = False
        for bf in self._files:
            if utils.range_cmp(store_op, bf) == 0:
                bf.do_store(store_op)
                store_ok = True
        if not store_ok:
            raise OSError(
                          "No suitable file found for store {}"
                          .format(store_op))
Esempio n. 6
0
    def do_revert(self, store_op):
        """
        Reverts a store made to a file.

        Performing a revert on a store that has not been made
        previously yields undefined behavior.

        :param store_op: The store to be reverted.
        :type store_op: Store
        :return: None
        :raises: Generic exception - to be precised later.
        """
        revert_ok = False
        for bf in self._files:
            if utils.range_cmp(store_op, bf) == 0:
                bf.do_revert(store_op)
                revert_ok = True
        if not revert_ok:
            raise OSError(
                          "No suitable file found for store {}"
                          .format(store_op))