1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-07 08:28:57 +00:00

Added a 'ready' getter to Drive, formally to let the drive take ownership of that test.

This commit is contained in:
Thomas Harte 2017-08-08 21:15:56 -04:00
parent b11d142cff
commit 7d1023ea98
2 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,11 @@ bool Drive::get_is_read_only() {
return false;
}
bool Drive::get_is_ready() {
// TODO: a real test for this.
return disk_ != nullptr;
}
std::shared_ptr<Track> Drive::get_track() {
if(disk_) return disk_->get_track_at_position(head_, (unsigned int)head_position_);
if(track_) return track_;

View File

@ -65,6 +65,11 @@ class Drive {
*/
void set_track(const std::shared_ptr<Track> &track);
/*!
@returns @c true if the drive is ready; @c false otherwise.
*/
bool get_is_ready();
private:
std::shared_ptr<Track> track_;
std::shared_ptr<Disk> disk_;