diff --git a/Aufgabe3/ConsoleApplication1/Buffer.cs b/Aufgabe3/ConsoleApplication1/Buffer.cs index eb56cb34380483197981c95399346ada24c17617..92062864f53dc0ef5eec61070f1d1bfabfe918ec 100644 --- a/Aufgabe3/ConsoleApplication1/Buffer.cs +++ b/Aufgabe3/ConsoleApplication1/Buffer.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Runtime.Serialization; using System.Threading; namespace ConsoleApplication1 @@ -25,7 +27,7 @@ namespace ConsoleApplication1 // Check whether the Queue is full and throws an Exception if so. if (_carQueue.Count == _size) { - throw new Exception("Buffer full"); + throw new QueueFullException("Buffer full"); } _carQueue.Enqueue(c); @@ -36,7 +38,7 @@ namespace ConsoleApplication1 { if (_carQueue.Count == 0) { - throw new Exception("Buffer empty"); + throw new QueueEmptyException("Buffer empty"); } return _carQueue.Dequeue(); @@ -60,4 +62,17 @@ namespace ConsoleApplication1 return this._mutex; } } + +} + +public class QueueEmptyException : Exception +{ + public QueueEmptyException(string bufferEmpty) + : base (bufferEmpty) { } +} + +public class QueueFullException : Exception +{ + public QueueFullException(string bufferEmpty) + : base (bufferEmpty) { } } diff --git a/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.csproj.AssemblyReference.cache b/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.csproj.AssemblyReference.cache index 20fe956fbd936cfdf51efb2a56bfa03f84449a55..eb48dfe115ae819b39829865d0424213d303e6e2 100644 Binary files a/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.csproj.AssemblyReference.cache and b/Aufgabe3/ConsoleApplication1/obj/Debug/ConsoleApplication1.csproj.AssemblyReference.cache differ