summaryrefslogtreecommitdiff
path: root/lib/delphi
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2022-09-03 18:52:35 +0200
committerJens Geyer <jensg@apache.org>2022-09-03 23:56:05 +0200
commit683263de0c76f133fb2dc7824775440fa6ad65fd (patch)
tree463e6ce41376a528660d6618bce0bad83c2f22fd /lib/delphi
parente0ee2c7514b812b5a18bfe9aab9594c5879dc34f (diff)
downloadthrift-683263de0c76f133fb2dc7824775440fa6ad65fd.tar.gz
THRIFT-5618 More consistent naming of container classes
Client: delphi Patch: Jens Geyer
Diffstat (limited to 'lib/delphi')
-rw-r--r--lib/delphi/src/Thrift.Collections.pas38
-rw-r--r--lib/delphi/test/serializer/TestSerializer.Data.pas2
2 files changed, 26 insertions, 14 deletions
diff --git a/lib/delphi/src/Thrift.Collections.pas b/lib/delphi/src/Thrift.Collections.pas
index ad852acca..36a8d9696 100644
--- a/lib/delphi/src/Thrift.Collections.pas
+++ b/lib/delphi/src/Thrift.Collections.pas
@@ -190,7 +190,7 @@ type
function ToString : string; override;
end;
- IHashSet<TValue> = interface(IThriftContainer)
+ IThriftHashSet<TValue> = interface(IThriftContainer)
['{0923A3B5-D4D4-48A8-91AD-40238E2EAD66}']
function GetEnumerator: TEnumerator<TValue>;
function GetIsReadOnly: Boolean;
@@ -204,7 +204,15 @@ type
function Remove( const item: TValue ): Boolean;
end;
- THashSetImpl<TValue> = class( TInterfacedObject, IHashSet<TValue>, IThriftContainer, ISupportsToString)
+ // compatibility
+ IHashSet<TValue> = interface( IThriftHashSet<TValue>)
+ ['{C3CF557F-21D9-4524-B899-D3145B0389BB}']
+ end deprecated 'use IThriftHashSet<T>';
+
+
+ {$WARN SYMBOL_DEPRECATED OFF}
+ TThriftHashSetImpl<TValue> = class( TInterfacedObject, IHashSet<TValue>, IThriftHashSet<TValue>, IThriftContainer, ISupportsToString)
+ {$WARN SYMBOL_DEPRECATED DEFAULT}
strict private
FDictionary : IThriftDictionary<TValue,Integer>;
FIsReadOnly: Boolean;
@@ -224,11 +232,15 @@ type
function ToString : string; override;
end;
+ // compatibility
+ THashSetImpl<TValue> = class( TThriftHashSetImpl<TValue>)
+ end deprecated 'use TThriftHashSetImpl<T>';
+
implementation
-{ THashSetImpl<TValue> }
+{ TThriftHashSetImpl<TValue>. }
-procedure THashSetImpl<TValue>.Add( const item: TValue);
+procedure TThriftHashSetImpl<TValue>.Add( const item: TValue);
begin
if not FDictionary.ContainsKey(item) then
begin
@@ -236,17 +248,17 @@ begin
end;
end;
-procedure THashSetImpl<TValue>.Clear;
+procedure TThriftHashSetImpl<TValue>.Clear;
begin
FDictionary.Clear;
end;
-function THashSetImpl<TValue>.Contains( const item: TValue): Boolean;
+function TThriftHashSetImpl<TValue>.Contains( const item: TValue): Boolean;
begin
Result := FDictionary.ContainsKey(item);
end;
-procedure THashSetImpl<TValue>.CopyTo(var A: TArray<TValue>; arrayIndex: Integer);
+procedure TThriftHashSetImpl<TValue>.CopyTo(var A: TArray<TValue>; arrayIndex: Integer);
var
i : Integer;
Enumlator : TEnumerator<TValue>;
@@ -259,28 +271,28 @@ begin
end;
end;
-constructor THashSetImpl<TValue>.Create;
+constructor TThriftHashSetImpl<TValue>.Create;
begin
inherited;
FDictionary := TThriftDictionaryImpl<TValue,Integer>.Create;
end;
-function THashSetImpl<TValue>.GetCount: Integer;
+function TThriftHashSetImpl<TValue>.GetCount: Integer;
begin
Result := FDictionary.Count;
end;
-function THashSetImpl<TValue>.GetEnumerator: TEnumerator<TValue>;
+function TThriftHashSetImpl<TValue>.GetEnumerator: TEnumerator<TValue>;
begin
Result := FDictionary.Keys.GetEnumerator;
end;
-function THashSetImpl<TValue>.GetIsReadOnly: Boolean;
+function TThriftHashSetImpl<TValue>.GetIsReadOnly: Boolean;
begin
Result := FIsReadOnly;
end;
-function THashSetImpl<TValue>.Remove( const item: TValue): Boolean;
+function TThriftHashSetImpl<TValue>.Remove( const item: TValue): Boolean;
begin
Result := False;
if FDictionary.ContainsKey( item ) then
@@ -290,7 +302,7 @@ begin
end;
end;
-function THashSetImpl<TValue>.ToString : string;
+function TThriftHashSetImpl<TValue>.ToString : string;
var elm : TValue;
sb : TThriftStringBuilder;
first : Boolean;
diff --git a/lib/delphi/test/serializer/TestSerializer.Data.pas b/lib/delphi/test/serializer/TestSerializer.Data.pas
index a90d65066..af366fd7b 100644
--- a/lib/delphi/test/serializer/TestSerializer.Data.pas
+++ b/lib/delphi/test/serializer/TestSerializer.Data.pas
@@ -230,7 +230,7 @@ begin
result.Big[0].setA_bite( $22);
result.Big[0].setA_bite( $23);
- result.Contain := THashSetImpl< IThriftList<string>>.Create;
+ result.Contain := TThriftHashSetImpl< IThriftList<string>>.Create;
stage1 := TThriftListImpl<String>.Create;
stage1.add( 'and a one');
stage1.add( 'and a two');