Skip to content

Commit

Permalink
chore: Restructuring folder/names with new vision
Browse files Browse the repository at this point in the history
  • Loading branch information
gcarreno committed Sep 25, 2023
1 parent 18b8675 commit 0179e47
Show file tree
Hide file tree
Showing 18 changed files with 197 additions and 133 deletions.
46 changes: 25 additions & 21 deletions examples/CLI/polykermacli.lpi
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="../../src/logger;../../src/dispatcher;../../src/modules;../../src/messages;../../src/threads"/>
<OtherUnitFiles Value="../../src/logging;../../src/dispatching;../../src/modules;../../src/threading"/>
<UnitOutputDirectory Value="../../bin/lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
Expand All @@ -51,6 +51,9 @@
</Debugging>
</Linking>
<Other>
<CompilerMessages>
<IgnoredMessages idx5024="True"/>
</CompilerMessages>
<ConfigFile>
<WriteConfigFilePath Value=""/>
</ConfigFile>
Expand All @@ -65,7 +68,7 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="../../src/logger;../../src/dispatcher;../../src/modules;../../src/messages;../../src/threads"/>
<OtherUnitFiles Value="../../src/logging;../../src/dispatching;../../src/modules;../../src/threading"/>
<UnitOutputDirectory Value="../../bin/lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
Expand All @@ -82,6 +85,9 @@
<LinkSmart Value="True"/>
</Linking>
<Other>
<CompilerMessages>
<IgnoredMessages idx5024="True"/>
</CompilerMessages>
<ConfigFile>
<WriteConfigFilePath Value=""/>
</ConfigFile>
Expand All @@ -96,31 +102,31 @@
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<Units Count="11">
<Units Count="10">
<Unit0>
<Filename Value="polykermacli.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKermaCLI"/>
</Unit0>
<Unit1>
<Filename Value="../../src/logger/polykerma.logger.pas"/>
<Filename Value="../../src/logging/polykerma.logging.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKerma.Logger"/>
<UnitName Value="PolyKerma.Logging"/>
</Unit1>
<Unit2>
<Filename Value="../../src/dispatcher/polykerma.dispatcher.common.pas"/>
<Filename Value="../../src/dispatching/polykerma.dispatching.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKerma.Dispatcher.Common"/>
<UnitName Value="PolyKerma.Dispatching"/>
</Unit2>
<Unit3>
<Filename Value="../../src/dispatcher/polykerma.dispatcher.interfaces.pas"/>
<Filename Value="../../src/dispatching/polykerma.dispatching.interfaces.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKerma.Dispatcher.Interfaces"/>
<UnitName Value="PolyKerma.Dispatching.Interfaces"/>
</Unit3>
<Unit4>
<Filename Value="../../src/dispatcher/polykerma.dispatcher.pas"/>
<Filename Value="../../src/dispatching/polykerma.dispatching.dispatcher.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKerma.Dispatcher"/>
<UnitName Value="PolyKerma.Dispatching.Dispatcher"/>
</Unit4>
<Unit5>
<Filename Value="../../src/modules/polykerma.modules.interfaces.pas"/>
Expand All @@ -132,23 +138,18 @@
<UnitName Value="PolyKerma.Modules.Module"/>
</Unit6>
<Unit7>
<Filename Value="../../src/messages/polykerma.messages.interfaces.pas"/>
<Filename Value="../../src/dispatching/polykerma.dispatching.message.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKerma.Messages.Interfaces"/>
<UnitName Value="PolyKerma.Dispatching.Message"/>
</Unit7>
<Unit8>
<Filename Value="../../src/messages/polykerma.messages.message.pas"/>
<Filename Value="../../src/threading/polykerma.threading.interfaces.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="PolyKerma.Messages.Message"/>
</Unit8>
<Unit9>
<Filename Value="../../src/threads/polykerma.threads.interfaces.pas"/>
<Filename Value="../../src/threading/polykerma.threading.thread.pas"/>
<IsPartOfProject Value="True"/>
</Unit9>
<Unit10>
<Filename Value="../../src/threads/polykerma.threads.thread.pas"/>
<IsPartOfProject Value="True"/>
</Unit10>
</Units>
</ProjectOptions>
<CompilerOptions>
Expand All @@ -158,10 +159,13 @@
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<OtherUnitFiles Value="../../src/logger;../../src/dispatcher;../../src/modules;../../src/messages;../../src/threads"/>
<OtherUnitFiles Value="../../src/logging;../../src/dispatching;../../src/modules;../../src/threading"/>
<UnitOutputDirectory Value="../../bin/lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Other>
<CompilerMessages>
<IgnoredMessages idx5024="True"/>
</CompilerMessages>
<ConfigFile>
<WriteConfigFilePath Value=""/>
</ConfigFile>
Expand Down
1 change: 0 additions & 1 deletion examples/CLI/polykermacli.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ procedure TPolyKermaCLI.PolyKermaSetup;
begin
FDispatcher:= TInterfacedDispatcher.Create;
module:= TInterfacedModule.Create(FDispatcher);
module:= nil;
end;

procedure TPolyKermaCLI.PolyKermaTearDown;
Expand Down
Empty file.
25 changes: 0 additions & 25 deletions src/dispatcher/polykerma.dispatcher.common.pas

This file was deleted.

23 changes: 0 additions & 23 deletions src/dispatcher/polykerma.dispatcher.interfaces.pas

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
;

Expand Down
42 changes: 42 additions & 0 deletions src/dispatching/polykerma.dispatching.interfaces.pas
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
29 changes: 29 additions & 0 deletions src/dispatching/polykerma.dispatching.pas
Original file line number Diff line number Diff line change
@@ -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.
19 changes: 19 additions & 0 deletions src/logging/polykerma.logging.interfaces.pas
Original file line number Diff line number Diff line change
@@ -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.

22 changes: 22 additions & 0 deletions src/logging/polykerma.logging.logger.pas
Original file line number Diff line number Diff line change
@@ -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.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unit PolyKerma.Logger;
unit PolyKerma.Logging;

{$mode ObjFPC}{$H+}

Expand Down
23 changes: 0 additions & 23 deletions src/messages/polykerma.messages.interfaces.pas

This file was deleted.

4 changes: 4 additions & 0 deletions src/modules/polykerma.modules.interfaces.pas
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
interface

uses
{$IFDEF FPC_DOTTEDUNITS}
System.Classes
{$ELSE FPC_DOTTEDUNITS}
Classes
{$ENDIF FPC_DOTTEDUNITS}
;

type
Expand Down
4 changes: 4 additions & 0 deletions src/modules/polykerma.modules.module.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 0179e47

Please sign in to comment.