mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-25 03:32:01 +00:00
Added a 'ready' getter to Drive
, formally to let the drive take ownership of that test.
This commit is contained in:
parent
b11d142cff
commit
7d1023ea98
@ -46,6 +46,11 @@ bool Drive::get_is_read_only() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Drive::get_is_ready() {
|
||||||
|
// TODO: a real test for this.
|
||||||
|
return disk_ != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<Track> Drive::get_track() {
|
std::shared_ptr<Track> Drive::get_track() {
|
||||||
if(disk_) return disk_->get_track_at_position(head_, (unsigned int)head_position_);
|
if(disk_) return disk_->get_track_at_position(head_, (unsigned int)head_position_);
|
||||||
if(track_) return track_;
|
if(track_) return track_;
|
||||||
|
@ -65,6 +65,11 @@ class Drive {
|
|||||||
*/
|
*/
|
||||||
void set_track(const std::shared_ptr<Track> &track);
|
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:
|
private:
|
||||||
std::shared_ptr<Track> track_;
|
std::shared_ptr<Track> track_;
|
||||||
std::shared_ptr<Disk> disk_;
|
std::shared_ptr<Disk> disk_;
|
||||||
|
Loading…
Reference in New Issue
Block a user