anchor.diff:   *                                                        *
    * hprose common unit for delphi.                         *
    *                                                        *
  - * LastModified: Oct 30, 2016                             *
  + * LastModified: Nov 2, 2016                              *
    * Author: Ma Bingyao <andot@hprose.com>                  *
    *                                                        *
   \**********************************************************/
  
positive.code:     function OutputFilter(const Data: TBytes; const Context: TContext): TBytes; virtual; abstract;
    end;
  
  const
  
  {$IFDEF CPU64}
  
negative.code: begin
    FUserData := TCaseInsensitiveHashMap.Create(16, 0.75, False);
    if AUserData <> nil then FUserData.PutAll(AUserData);
  end;
  
  { TFilterList }
  
  constructor TFilterList.Create();
  begin
    FFilters := THashedList.Create;
  end;
  
  function TFilterList.Get(Index: Integer): IFilter;
  var
    F: Variant;
  begin
    Result := nil;
    F := FFilters[Index];
    if (not VarIsNull(F)) and (not VarIsEmpty(F)) then
      VarToIntf(F, IFilter, Result);
  end;
  
  procedure TFilterList.Put(Index: Integer; const Value: IFilter);
  begin
    FFilters[Index] := Value;
  end;
  
  function TFilterList.GetCount: Integer;
  begin
    Result := FFilters.Count;
  end;
  
  function TFilterList.Add(const Filter: IFilter): TFilterList;
  begin
    FFilters.Add(Filter);
    Result := Self;
  end;
  
  function TFilterList.Remove(const Filter: IFilter): TFilterList;
  begin
    FFilters.Remove(Filter);
    Result := Self;
  end;
  
  function TFilterList.InputFilter(const Data: TBytes; const Context: TContext
    ): TBytes;
  var
    I: Integer;
    AFilter: IFilter;
  begin
    Result := Data;
    for I := FFilters.Count - 1 downto 0 do begin
      VarToIntf(FFilters[I], IFilter, AFilter);
      Result := AFilter.InputFilter(Result, Context);
    end;
  end;
  
  function TFilterList.OutputFilter(const Data: TBytes; const Context: TContext
    ): TBytes;
  var
    I: Integer;
    AFilter: IFilter;
  begin
    Result := Data;
    for I := 0 to FFilters.Count - 1 do begin
      VarToIntf(FFilters[I], IFilter, AFilter);
      Result := AFilter.OutputFilter(Result, Context);
    end;
  end;
  
  { TVarObjectType }
  