diff --git a/examples/CLI/polykermacli.lpi b/examples/CLI/polykermacli.lpi index f64ef8c..d6fe0ae 100644 --- a/examples/CLI/polykermacli.lpi +++ b/examples/CLI/polykermacli.lpi @@ -25,7 +25,7 @@ - + @@ -51,6 +51,9 @@ + + + @@ -65,7 +68,7 @@ - + @@ -82,6 +85,9 @@ + + + @@ -96,31 +102,31 @@ - + - + - + - + - + - + - + - + - + @@ -132,23 +138,18 @@ - + - + - + - - + - - - - @@ -158,10 +159,13 @@ - + + + + diff --git a/examples/CLI/polykermacli.lpr b/examples/CLI/polykermacli.lpr index 4a916fb..706da8f 100644 --- a/examples/CLI/polykermacli.lpr +++ b/examples/CLI/polykermacli.lpr @@ -89,7 +89,6 @@ procedure TPolyKermaCLI.PolyKermaSetup; begin FDispatcher:= TInterfacedDispatcher.Create; module:= TInterfacedModule.Create(FDispatcher); - module:= nil; end; procedure TPolyKermaCLI.PolyKermaTearDown; diff --git a/src/containers/polykerma.containers.interfaces.pas b/src/containers/polykerma.containers.interfaces.pas deleted file mode 100644 index e69de29..0000000 diff --git a/src/dispatcher/polykerma.dispatcher.common.pas b/src/dispatcher/polykerma.dispatcher.common.pas deleted file mode 100644 index fc103b3..0000000 --- a/src/dispatcher/polykerma.dispatcher.common.pas +++ /dev/null @@ -1,25 +0,0 @@ -unit PolyKerma.Dispatcher.Common; - -{$mode objfpc}{$H+} - -interface - -uses - Classes -; - -const - cDispatcherChannelControllerOut = 'controller.out'; - cDispatcherChannelControllerIn = 'controller.in'; - cDispatcherChannelCommsOut = 'comms.out'; - cDispatcherChannelCommsIn = 'comms.in'; - cDispatcherChannelModelOut = 'model.out'; - cDispatcherChannelModelIn = 'model.in'; - - { #todo -ogcarreno -cexample : Remove after testing } - cDispatcherChannelModuleOut = 'module.out'; - cDispatcherChannelModuleIn = 'module.in'; - -implementation - -end. diff --git a/src/dispatcher/polykerma.dispatcher.interfaces.pas b/src/dispatcher/polykerma.dispatcher.interfaces.pas deleted file mode 100644 index deade63..0000000 --- a/src/dispatcher/polykerma.dispatcher.interfaces.pas +++ /dev/null @@ -1,23 +0,0 @@ -unit PolyKerma.Dispatcher.Interfaces; - -{$mode objfpc}{$H+} - -interface - -uses - Classes -, PolyKerma.Messages.Interfaces -, PolyKerma.Modules.Interfaces -; - -type -{ IDispatcher } - IDispatcher = Interface - ['{1CD54522-D37B-486E-9181-A97CCF768DE9}'] - function Register(const AChannel: String; const AModule: IModule): Boolean; - procedure Post(const AMessage: IMessage); - end; - -implementation - -end. diff --git a/src/dispatcher/polykerma.dispatcher.pas b/src/dispatching/polykerma.dispatching.dispatcher.pas similarity index 86% rename from src/dispatcher/polykerma.dispatcher.pas rename to src/dispatching/polykerma.dispatching.dispatcher.pas index 6932ec8..2db5b64 100644 --- a/src/dispatcher/polykerma.dispatcher.pas +++ b/src/dispatching/polykerma.dispatching.dispatcher.pas @@ -1,17 +1,21 @@ -unit PolyKerma.Dispatcher; +unit PolyKerma.Dispatching.Dispatcher; {$mode objfpc}{$H+} interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +, System.SysUtils +{$ELSE FPC_DOTTEDUNITS} Classes , SysUtils +{$ENDIF FPC_DOTTEDUNITS} //, contnrs -, PolyKerma.Logger +, PolyKerma.Logging , PolyKerma.Dispatcher.Interfaces -//, PolyKerma.Dispatcher.Common -, PolyKerma.Messages.Interfaces +//, PolyKerma.Dispatching , PolyKerma.Modules.Interfaces ; diff --git a/src/dispatching/polykerma.dispatching.interfaces.pas b/src/dispatching/polykerma.dispatching.interfaces.pas new file mode 100644 index 0000000..ffaed74 --- /dev/null +++ b/src/dispatching/polykerma.dispatching.interfaces.pas @@ -0,0 +1,42 @@ +unit PolyKerma.Dispatching.Interfaces; + +{$mode objfpc}{$H+} + +interface + +uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} + Classes +{$ENDIF FPC_DOTTEDUNITS} +, PolyKerma.Modules.Interfaces +; + +type +{ IDispatcher } + IDispatcher = Interface + ['{1CD54522-D37B-486E-9181-A97CCF768DE9}'] + function Register(const AChannel: String; const AModule: IModule): Boolean; + procedure Post(const AMessage: IMessage); + procedure ProcessMessage(const AMessage: IMessage); + end; + +{ IMessage } + IMessage = Interface + ['{62E0D2A6-6AEE-42DF-BADD-D210BA7A2BD1}'] + function GetChannel: String; + + function GetPayload: String; + procedure SetPayload(const APayload: String); + + property Channel: String + read GetChannel; + property Payload: String + read GetPayload + write SetPayload; + end; + +implementation + +end. diff --git a/src/messages/polykerma.messages.message.pas b/src/dispatching/polykerma.dispatching.message.pas similarity index 81% rename from src/messages/polykerma.messages.message.pas rename to src/dispatching/polykerma.dispatching.message.pas index 6e49496..d642f54 100644 --- a/src/messages/polykerma.messages.message.pas +++ b/src/dispatching/polykerma.dispatching.message.pas @@ -1,14 +1,19 @@ -unit PolyKerma.Messages.Message; +unit PolyKerma.Dispatching.Message; {$mode objfpc}{$H+} interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +, System.SysUtils +{$ELSE FPC_DOTTEDUNITS} Classes , SysUtils -, PolyKerma.Logger -, PolyKerma.Messages.Interfaces +{$ENDIF FPC_DOTTEDUNITS} +, PolyKerma.Logging +, PolyKerma.Dispatching.Interfaces ; type diff --git a/src/dispatching/polykerma.dispatching.pas b/src/dispatching/polykerma.dispatching.pas new file mode 100644 index 0000000..2b51d67 --- /dev/null +++ b/src/dispatching/polykerma.dispatching.pas @@ -0,0 +1,29 @@ +unit PolyKerma.Dispatching; + +{$mode objfpc}{$H+} + +interface + +(*uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} + Classes +{$ENDIF FPC_DOTTEDUNITS} +;*) + +const + cChannelControllerOut = 'controller.out'; + cChannelControllerIn = 'controller.in'; + cChannelCommsOut = 'comms.out'; + cChannelCommsIn = 'comms.in'; + cChannelModelOut = 'model.out'; + cChannelModelIn = 'model.in'; + + { #todo -ogcarreno -cexample : Remove after testing } + cChannelModuleOut = 'module.out'; + cChannelModuleIn = 'module.in'; + +implementation + +end. diff --git a/src/logging/polykerma.logging.interfaces.pas b/src/logging/polykerma.logging.interfaces.pas new file mode 100644 index 0000000..8cf251e --- /dev/null +++ b/src/logging/polykerma.logging.interfaces.pas @@ -0,0 +1,19 @@ +unit PolyKerma.Logging.Interfaces; + +{$mode ObjFPC}{$H+} + +interface + +uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} + Classes +{$ENDIF FPC_DOTTEDUNITS} +; + + +implementation + +end. + diff --git a/src/logging/polykerma.logging.logger.pas b/src/logging/polykerma.logging.logger.pas new file mode 100644 index 0000000..c2fb5b1 --- /dev/null +++ b/src/logging/polykerma.logging.logger.pas @@ -0,0 +1,22 @@ +unit PolyKerma.Logging.Logger; + +{$mode ObjFPC}{$H+} + +interface + +uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +, System.SysUtils +, System.DateUtils +{$ELSE FPC_DOTTEDUNITS} + Classes +, SysUtils +, DateUtils +{$ENDIF FPC_DOTTEDUNITS} +; + +implementation + +end. + diff --git a/src/logger/polykerma.logger.pas b/src/logging/polykerma.logging.pas similarity index 96% rename from src/logger/polykerma.logger.pas rename to src/logging/polykerma.logging.pas index b201fed..3465d78 100644 --- a/src/logger/polykerma.logger.pas +++ b/src/logging/polykerma.logging.pas @@ -1,4 +1,4 @@ -unit PolyKerma.Logger; +unit PolyKerma.Logging; {$mode ObjFPC}{$H+} diff --git a/src/messages/polykerma.messages.interfaces.pas b/src/messages/polykerma.messages.interfaces.pas deleted file mode 100644 index 3d194df..0000000 --- a/src/messages/polykerma.messages.interfaces.pas +++ /dev/null @@ -1,23 +0,0 @@ -unit PolyKerma.Messages.Interfaces; - -{$mode objfpc}{$H+} - -interface - -uses - Classes -; - -type -{ IMessage } - IMessage = Interface - ['{62E0D2A6-6AEE-42DF-BADD-D210BA7A2BD1}'] - function GetChannel: String; - property Channel: String - read GetChannel; - end; - -implementation - -end. - diff --git a/src/modules/polykerma.modules.interfaces.pas b/src/modules/polykerma.modules.interfaces.pas index e4935a4..1665116 100644 --- a/src/modules/polykerma.modules.interfaces.pas +++ b/src/modules/polykerma.modules.interfaces.pas @@ -5,7 +5,11 @@ interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} Classes +{$ENDIF FPC_DOTTEDUNITS} ; type diff --git a/src/modules/polykerma.modules.module.pas b/src/modules/polykerma.modules.module.pas index 76744ed..4c8a383 100644 --- a/src/modules/polykerma.modules.module.pas +++ b/src/modules/polykerma.modules.module.pas @@ -5,7 +5,11 @@ interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} Classes +{$ENDIF FPC_DOTTEDUNITS} , PolyKerma.Logger , PolyKerma.Dispatcher.Common , PolyKerma.Dispatcher.Interfaces diff --git a/src/threads/polykerma.threads.interfaces.pas b/src/threading/polykerma.threading.interfaces.pas similarity index 67% rename from src/threads/polykerma.threads.interfaces.pas rename to src/threading/polykerma.threading.interfaces.pas index 288e776..f46dd9a 100644 --- a/src/threads/polykerma.threads.interfaces.pas +++ b/src/threading/polykerma.threading.interfaces.pas @@ -1,11 +1,15 @@ -unit PolyKerma.Threads.Interfaces; +unit PolyKerma.Threading.Interfaces; {$mode ObjFPC}{$H+} interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} Classes +{$ENDIF FPC_DOTTEDUNITS} ; type diff --git a/src/threads/polykerma.threads.thread.pas b/src/threading/polykerma.threading.thread.pas similarity index 91% rename from src/threads/polykerma.threads.thread.pas rename to src/threading/polykerma.threading.thread.pas index 88b9314..abcb1be 100644 --- a/src/threads/polykerma.threads.thread.pas +++ b/src/threading/polykerma.threading.thread.pas @@ -1,12 +1,16 @@ -unit PolyKerma.Threads.Thread; +unit PolyKerma.Threading.Thread; {$mode ObjFPC}{$H+} interface uses +{$IFDEF FPC_DOTTEDUNITS} + System.Classes +{$ELSE FPC_DOTTEDUNITS} Classes -, PolyKerma.Threads.Interfaces +{$ENDIF FPC_DOTTEDUNITS} +, PolyKerma.Threading.Interfaces ; type diff --git a/tests/polykermatests.lpi b/tests/polykermatests.lpi index 7108a04..81dd591 100644 --- a/tests/polykermatests.lpi +++ b/tests/polykermatests.lpi @@ -24,7 +24,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -90,7 +90,7 @@ - + @@ -102,19 +102,19 @@ - + - + - + - + - + - + @@ -122,45 +122,40 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - @@ -170,7 +165,7 @@ - +