- /// @param copied - A pointer to a nunber that is filled in with the number
- /// of bytes actually read. May be NULL.
- /// @result - 0 if successful; -1 if not. Failure may be due to a
- /// bounds violation or an implementation-specific error.
- virtual int readBytes(uint64_t address,
- uint64_t size,
- uint8_t* buf,
- uint64_t* copied) const;
+ /// @param Size - The number of bytes to copy.
+ /// @param Address - The address of the first byte, in the same space as
+ /// getBase().
+ /// @result - The number of bytes read.
+ virtual uint64_t readBytes(uint8_t *Buf, uint64_t Size,
+ uint64_t Address) const = 0;
+
+ /// Ensures that the requested data is in memory, and returns a pointer to it.
+ /// More efficient than using readBytes if the data is already in memory. May
+ /// block until (address - base + size) bytes have been read
+ /// @param address - address of the byte, in the same space as getBase()
+ /// @param size - amount of data that must be available on return
+ /// @result - valid pointer to the requested data
+ virtual const uint8_t *getPointer(uint64_t address, uint64_t size) const = 0;
+
+ /// Returns true if the address is within the object (i.e. between base and
+ /// base + extent - 1 inclusive). May block until (address - base) bytes have
+ /// been read
+ /// @param address - address of the byte, in the same space as getBase()
+ /// @result - true if the address may be read with readByte()
+ virtual bool isValidAddress(uint64_t address) const = 0;