Changeset 142 for trunk/Packages


Ignore:
Timestamp:
Sep 10, 2022, 6:24:58 PM (2 years ago)
Author:
chronos
Message:
Location:
trunk/Packages
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Common.pas

    r138 r142  
    3636initialization
    3737  RegisterPackage('Common', @Register);
     38
    3839end.
  • trunk/Packages/PersistentData/Backend/UPDClientMemory.pas

    r138 r142  
    1919    function SearchObject(Id: Integer): TObjectProxy;
    2020  public
    21     Objects: TObjectList<TObjectProxy>;
     21    Objects: TObjectProxies;
    2222    procedure ObjectLoad(AObject: TObjectProxy); override;
    2323    procedure ObjectSave(AObject: TObjectProxy); override;
     
    9696    else begin
    9797      AObject.Id := GetNewObjectId;
    98       Obj := TObjectProxy(Objects.Add(TObjectProxy.Create));
     98      Obj := Objects.AddProxy;
    9999      Obj.Assign(AObject);
    100100    end;
     
    173173begin
    174174  inherited;
    175   Objects := TObjectList<TObjectProxy>.Create;
     175  Objects := TObjectProxies.Create;
    176176  BackendName := 'Memory';
    177177end;
     
    179179destructor TPDClientMemory.Destroy;
    180180begin
    181   Objects.Free;
     181  FreeAndNil(Objects);
    182182  inherited;
    183183end;
     
    185185procedure TPDClientMemory.Connect;
    186186begin
    187   inherited Connect;
     187  inherited;
    188188end;
    189189
    190190procedure TPDClientMemory.Disconnect;
    191191begin
    192   inherited Disconnect;
     192  inherited;
    193193end;
    194194
  • trunk/Packages/PersistentData/Backend/UPDClientMySQL.pas

    r138 r142  
    153153procedure TPDClientMySQL.ListSave(AList: TListProxy);
    154154begin
    155 
    156155end;
    157156
  • trunk/Packages/PersistentData/PersistentData.lpk

    r138 r142  
    1111      <SearchPaths>
    1212        <OtherUnitFiles Value="Backend"/>
    13         <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     13        <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    1414      </SearchPaths>
    1515      <Parsing>
     
    2121        </SyntaxOptions>
    2222      </Parsing>
    23       <CodeGeneration>
    24         <Checks>
    25           <IOChecks Value="True"/>
    26           <RangeChecks Value="True"/>
    27           <OverflowChecks Value="True"/>
    28           <StackChecks Value="True"/>
    29         </Checks>
    30       </CodeGeneration>
     23      <Linking>
     24        <Debugging>
     25          <GenerateDebugInfo Value="False"/>
     26        </Debugging>
     27      </Linking>
    3128    </CompilerOptions>
    3229    <Description Value="Generic data persistence layer"/>
    3330    <License Value="GNU/GPL"/>
    34     <Version Minor="1"/>
     31    <Version Minor="2"/>
    3532    <Files Count="8">
    3633      <Item1>
     
    6966    </Files>
    7067    <CompatibilityMode Value="True"/>
     68    <i18n>
     69      <EnableI18N Value="True"/>
     70    </i18n>
    7171    <RequiredPkgs Count="2">
    7272      <Item1>
  • trunk/Packages/PersistentData/UPDClient.pas

    r138 r142  
    3131    destructor Destroy; override;
    3232    procedure Assign(Source: TObjectProxy);
     33  end;
     34
     35  { TObjectProxies }
     36
     37  TObjectProxies = class(TObjectList<TObjectProxy>)
     38    function AddProxy: TObjectProxy;
    3339  end;
    3440
     
    7278  end;
    7379
    74   { TPDTypePropertyList }
    75 
    76   TPDTypePropertyList = class(TObjectList<TPDTypeProperty>)
     80  { TPDTypeProperties }
     81
     82  TPDTypeProperties = class(TObjectList<TPDTypeProperty>)
    7783    Client: TPDClient;
    78     procedure AddSimple(Name: string; TypeName: string; Unique: Boolean = False;
    79       Index: Boolean = False);
     84    function AddSimple(Name: string; TypeName: string; Unique: Boolean = False;
     85      Index: Boolean = False): TPDTypeProperty;
    8086  end;
    8187
     
    8995    Name: string;
    9096    DbType: string;
    91     Properties: TPDTypePropertyList;
     97    Properties: TPDTypeProperties;
    9298    function IsDefined: Boolean;
    9399    procedure Define;
     
    98104  end;
    99105
    100   { TPDTypeList }
    101 
    102   TPDTypeList = class(TObjectList<TPDType>)
     106  { TPDTypes }
     107
     108  TPDTypes = class(TObjectList<TPDType>)
    103109    Client: TPDClient;
    104110    function AddType(Name: string; DbType: string = ''): TPDType;
     
    119125    procedure SetConnectionString(AValue: string); virtual;
    120126  public
    121     Types: TPDTypeList;
     127    Types: TPDTypes;
    122128    Version: string;
    123129    BackendName: string;
     
    156162implementation
    157163
    158 { TPDTypePropertyList }
    159 
    160 procedure TPDTypePropertyList.AddSimple(Name: string; TypeName: string;
    161   Unique: Boolean = False; Index: Boolean = False);
    162 var
    163   NewProperty: TPDTypeProperty;
    164 begin
    165   NewProperty := TPDTypeProperty(Add(TPDTypeProperty.Create));
    166   NewProperty.Name := Name;
    167   NewProperty.DbType := Client.Types.SearchByName(TypeName);
    168   NewProperty.Unique := Unique;
    169   NewProperty.Index := Index;
    170 end;
    171 
    172 
    173 { TPDTypeList }
    174 
    175 function TPDTypeList.AddType(Name: string; DbType: string = ''): TPDType;
    176 begin
    177   Result := TPDType(Add(TPDType.Create));
     164{ TObjectProxies }
     165
     166function TObjectProxies.AddProxy: TObjectProxy;
     167begin
     168  Result := TObjectProxy.Create;
     169  Add(Result);
     170end;
     171
     172{ TPDTypeProperties }
     173
     174function TPDTypeProperties.AddSimple(Name: string; TypeName: string;
     175  Unique: Boolean = False; Index: Boolean = False): TPDTypeProperty;
     176begin
     177  Result := TPDTypeProperty.Create;
     178  Result.Name := Name;
     179  Result.DbType := Client.Types.SearchByName(TypeName);
     180  Result.Unique := Unique;
     181  Result.Index := Index;
     182  Add(Result);
     183end;
     184
     185{ TPDTypes }
     186
     187function TPDTypes.AddType(Name: string; DbType: string = ''): TPDType;
     188begin
     189  Result := TPDType.Create;
    178190  Result.Client := Client;
    179191  Result.Name := Name;
    180192  Result.DbType := DbType;
    181 end;
    182 
    183 function TPDTypeList.SearchByName(Name: string): TPDType;
     193  Add(Result);
     194end;
     195
     196function TPDTypes.SearchByName(Name: string): TPDType;
    184197var
    185198  I: Integer;
     
    218231constructor TPDType.Create;
    219232begin
    220   Properties := TPDTypePropertyList.Create;
     233  Properties := TPDTypeProperties.Create;
    221234end;
    222235
    223236destructor TPDType.Destroy;
    224237begin
    225   Properties.Free;
     238  FreeAndNil(Properties);
    226239  inherited;
    227240end;
     
    254267destructor TObjectProxy.Destroy;
    255268begin
    256   Properties.Free;
     269  FreeAndNil(Properties);
    257270  inherited;
    258271end;
     
    285298destructor TListProxy.Destroy;
    286299begin
    287   Objects.Free;
    288   ColumnsFilter.Free;
     300  FreeAndNil(Objects);
     301  FreeAndNil(ColumnsFilter);
    289302  inherited;
    290303end;
     
    311324procedure TPDClient.SetConnectionString(AValue: string);
    312325begin
    313 
    314326end;
    315327
     
    413425begin
    414426  inherited;
    415   Types := TPDTypeList.Create;
     427  Types := TPDTypes.Create;
    416428  Types.Client := Self;
    417429  InitSystemTypes;
     
    420432destructor TPDClient.Destroy;
    421433begin
    422   Types.Free;
     434  FreeAndNil(Types);
    423435  inherited;
    424436end;
     
    434446procedure TPDClient.Install;
    435447begin
    436 
    437448end;
    438449
     
    444455procedure TPDClient.Update;
    445456begin
    446 
    447457end;
    448458
  • trunk/Packages/PersistentData/UPersistentData.pas

    r138 r142  
    1212  end;
    1313
     14  TPDManagerItems = class(TObjectList<TPDManagerItem>)
     15  end;
     16
    1417  { TPDManager }
    1518
    1619  TPDManager = class(TComponent)
    1720  public
    18     Items: TObjectList<TPDManagerItem>;
     21    Items: TPDManagerItems;
    1922    procedure Register(ClientClass: TPDClientClass);
    2023    procedure LoadToStrings(Strings: TStrings);
     
    7679begin
    7780  inherited;
    78   Items := TObjectList<TPDManagerItem>.Create;
     81  Items := TPDManagerItems.Create;
    7982end;
    8083
Note: See TracChangeset for help on using the changeset viewer.