mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-09 20:25:19 +00:00
Added a 'ready' getter to Drive
, formally to let the drive take ownership of that test.
This commit is contained in:
@@ -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_;
|
||||
|
@@ -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_;
|
||||
|
Reference in New Issue
Block a user