| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | /** | ||
| 4 | * @brief Gate interface for barrier control abstraction | ||
| 5 | * | ||
| 6 | * This interface abstracts the physical gate components (button, light barrier, motor) | ||
| 7 | * allowing the gate controller logic to be independent of hardware specifics. | ||
| 8 | */ | ||
| 9 | class IGate { | ||
| 10 | public: | ||
| 11 | 24 | virtual ~IGate() = default; | |
| 12 | |||
| 13 | /** | ||
| 14 | * @brief Open the barrier | ||
| 15 | */ | ||
| 16 | virtual void open() = 0; | ||
| 17 | |||
| 18 | /** | ||
| 19 | * @brief Close the barrier | ||
| 20 | */ | ||
| 21 | virtual void close() = 0; | ||
| 22 | |||
| 23 | /** | ||
| 24 | * @brief Check if barrier is currently open | ||
| 25 | * @return true if barrier is open, false otherwise | ||
| 26 | */ | ||
| 27 | virtual bool isOpen() const = 0; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * @brief Check if car is detected in light barrier | ||
| 31 | * @return true if car is blocking light barrier, false otherwise | ||
| 32 | */ | ||
| 33 | virtual bool isCarDetected() const = 0; | ||
| 34 | }; | ||
| 35 |