48 |
|
|
49 |
|
} |
50 |
|
|
51 |
< |
ISharedMemoryExt = interface(ISharedMemory) |
52 |
< |
['{7449e122-61c0-4ea9-acf4-f0a420af14aa}'] |
51 |
> |
ISharedMemory = interface |
52 |
> |
['{db77bdd4-233a-4c9c-9212-dd7945e2e57c}'] |
53 |
|
function IsInitialiser: boolean; |
54 |
+ |
function Allocate(Size: integer): PByte; |
55 |
+ |
function GetLastAllocationSize: integer; |
56 |
+ |
property LastAllocationSize: integer read GetLastAllocationSize; |
57 |
|
end; |
58 |
|
|
59 |
< |
TSharedMemory = class(TIpcCommon,ISharedMemoryExt) |
59 |
> |
|
60 |
> |
TSharedMemory = class(TIpcCommon,ISharedMemory) |
61 |
|
private |
62 |
|
FBuffer: PByte; |
63 |
|
FLastAllocationSize: integer; |
150 |
|
|
151 |
|
TMultilockGate = class(TIpcCommon, IMultilockGate) |
152 |
|
private |
153 |
< |
FSharedMemory: ISharedMemoryExt; |
153 |
> |
FSharedMemory: ISharedMemory; |
154 |
|
FOnGateTimeout: TNotifyEvent; |
155 |
|
FEvent: THandle; |
156 |
|
FLockCount: PInteger; |
157 |
|
FMutex: TMutex; |
158 |
|
public |
159 |
< |
constructor Create(EventName: string; sm: ISharedMemoryExt); |
159 |
> |
constructor Create(EventName: string; sm: ISharedMemory); |
160 |
|
destructor Destroy; override; |
161 |
|
procedure Lock; |
162 |
|
procedure Unlock; |
173 |
|
TIPCInterface = class(TIpcCommon, IIPCInterface) |
174 |
|
private |
175 |
|
FMaxBufferSize: integer; |
176 |
< |
FSharedMemory: ISharedMemoryExt; |
176 |
> |
FSharedMemory: ISharedMemory; |
177 |
|
FWriteLock: IMutex; |
178 |
|
FBuffer: PByte; |
179 |
|
FTraceDataType, |
198 |
|
function GetReadFinishedEvent: IMultiLockGate; |
199 |
|
function GetWriteLock: IMutex; |
200 |
|
function GetMonitorCount: integer; |
197 |
– |
function GetSharedMemory: ISharedMemory; |
201 |
|
function GetMaxBufferSize: integer; |
202 |
|
property DataAvailableEvent: ISingleLockGate read GetDataAvailableEvent; |
203 |
|
property WriterBusyEvent: ISingleLockGate read GetWriterBusyEvent; |
205 |
|
property ReadFinishedEvent: IMultiLockGate read GetReadFinishedEvent; |
206 |
|
property WriteLock: IMutex read GetWriteLock; |
207 |
|
property MonitorCount: integer read GetMonitorCount; |
205 |
– |
property SharedMemory: ISharedMemory read GetSharedMemory; |
208 |
|
property MaxBufferSize: integer read GetMaxBufferSize; |
209 |
|
end; |
210 |
|
|
363 |
|
|
364 |
|
{ TMultilockGate } |
365 |
|
|
366 |
< |
constructor TMultilockGate.Create(EventName: string; sm: ISharedMemoryExt); |
366 |
> |
constructor TMultilockGate.Create(EventName: string; sm: ISharedMemory); |
367 |
|
begin |
368 |
|
inherited Create; |
369 |
|
FSharedMemory := sm; |
456 |
|
Result := FMonitorCount^ |
457 |
|
end; |
458 |
|
|
457 |
– |
function TIPCInterface.GetSharedMemory: ISharedMemory; |
458 |
– |
begin |
459 |
– |
Result := FSharedMemory; |
460 |
– |
end; |
461 |
– |
|
459 |
|
function TIPCInterface.GetMaxBufferSize: integer; |
460 |
|
begin |
461 |
|
Result := FMaxBufferSize; |