with Ada_Store.PoST.Input_Queue; package Ada_Store.PoST.Device.Alarm is type Instance is new Ada_Store.PoST.Device.Instance with private; procedure Open (Alarm : in out Instance); type Sound_Type is ( Information, Warning, Error, Fatal ); procedure Sound (Alarm : in Instance; Like : in Sound_Type); procedure Flush (Alarm : in out Instance; Flush_Mode : in Device_Mode); procedure Accept_Input (Alarm : in out Instance; Input : in Input_Queue.Message_Ptr); private type Instance is new Ada_Store.PoST.Device.Instance with null record; end Ada_Store.PoST.Device.Alarm;
with Ada.Text_IO; package body Ada_Store.PoST.Device.Alarm is procedure Open (Alarm : in out Instance) is begin null; end Open; procedure Sound (Alarm : in Instance; Like : in Sound_Type) is begin case Like is when Information => null; when Warning .. Error => Ada.Text_IO.Put(Character'Val(7)); when Fatal => Ada.Text_IO.Put(Character'Val(7)); Ada.Text_IO.Put(Character'Val(7)); Ada.Text_IO.Put(Character'Val(7)); end case; end Sound; procedure Flush (Alarm : in out Instance; Flush_Mode : in Device_Mode) is begin null; end Flush; procedure Accept_Input (Alarm : in out Instance; Input : in Input_Queue.Message_Ptr) is begin Input.all := (Action => Input_Queue.Unknown, Input => (others => Character'Val(0)), Length => 0); Input_Queue.Append(Input); end Accept_Input; end Ada_Store.PoST.Device.Alarm;
Copyright ©
1996 Simon Johnston &
Addison Wesley Longman