Orders (ElevatorProject v0.1.0)
Maintains a set of uniqe orders. Orders with equal button type and floor but different owners are counted as different orders, to be able to keep track of the cab calls of multiple elevators.
Uses the following modules:
- Order
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Deletes an order from the set. If the order to be deleted is a hall call, all orders with the given button type and floor are deleted from the set.
Retrieves the set of orders.
Adds an order to the set.
Sets the order set.
Link to this section Functions
child_spec(arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
delete(order)
Deletes an order from the set. If the order to be deleted is a hall call, all orders with the given button type and floor are deleted from the set.
Parameters
- order: Order to be deleted :: %Order{}
Return
- :ok :: atom()
get()
Retrieves the set of orders.
Return
- The current order set :: %MapSet
new(order)
Adds an order to the set.
Parameters
- order: Order to be added :: %Order{}
Return
- :ok :: atom()
set(orders)
Sets the order set.
Parameters
- orders: New value of the order set :: %Order{}
Return
- :ok :: atom()