/// to return the right result, getExtent must also wait for all the data to
/// arrive; therefore it should not be called on objects which are actually
/// streamed (this would defeat the purpose of streaming). Instead,
-/// isValidAddress and isObjectEnd can be used to test addresses without knowing
-/// the exact size of the stream. Finally, getPointer can be used instead of
-/// readBytes to avoid extra copying.
+/// isValidAddress can be used to test addresses without knowing the exact size
+/// of the stream. Finally, getPointer can be used instead of readBytes to avoid
+/// extra copying.
class MemoryObject {
public:
virtual ~MemoryObject();
/// Tries to read a contiguous range of bytes from the region, up to the end
/// of the region.
///
- /// @param address - The address of the first byte, in the same space as
- /// getBase().
- /// @param size - The number of bytes to copy.
- /// @param buf - A pointer to a buffer to be filled in. Must be non-NULL
+ /// @param Buf - A pointer to a buffer to be filled in. Must be non-NULL
/// and large enough to hold size bytes.
+ /// @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;
/// @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;
-
- /// Returns true if the address is one past the end of the object (i.e. if it
- /// is equal to base + extent). 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 is equal to base + extent
- virtual bool isObjectEnd(uint64_t address) const = 0;
};
}