unit class_param;

interface

uses class_model, class_basics;


{$REGION 'ÊËÀÑÑ "ÏÀÐÀÌÅÒÐ"'}
type
  TRDParam = class (TRD_Something)
    private
    public
      models: TRDModelList;

      constructor Create ( in_param_name, in_param_desc: string); override;
      destructor Destroy; override;
end;
{$ENDREGION}

type
  TRDParamList = class (TRD_List)
    private
      function set_current_param (in_param_index: integer): boolean;
    public
      function Find_by_name( in_object_name: string ): TRDParam;
      function Next_param: TRDParam;
      function Prev_param: TRDParam;
      function First_param: TRDParam;
      function Last_param: TRDParam;
      function Get_current_param: TRDParam;
      function Find_by_index (in_index: integer): TRDParam;
      function Add (in_param: TRDParam):integer; virtual;
end;

implementation
{$REGION 'ÊËÀÑÑ "ÏÀÐÀÌÅÒÐ" ÐÅÀËÈÇÀÖÈß'}
constructor TRDParam.Create( in_param_name, in_param_desc: string);
begin
Assert( ( in_param_name <> '' ),
        'Âõîäíîå ïîëå ÈÌß ÏÀÐÀÌÅÒÐÀ êëàññà RDParam ïóñòîå!'+'{BC114396-B595-4724-A9F7-CD8141188280}');
  inherited Create(in_param_name, in_param_desc);
  self.models := TRDModelList.Create;
end;

destructor TRDParam.Destroy;
begin
  self.models.Free;
  inherited Destroy;
end;
{$ENDREGION}

{ TRDParamList }

function TRDParamList.Add(in_param: TRDParam): integer;
var inserted_num: integer;
begin
  inserted_num := inherited add(in_param);
  self.set_current_param( inserted_num );
  result := inserted_num;
end;

function TRDParamList.Find_by_index(in_index: integer): TRDParam;
begin
  result := inherited Find_by_index( in_index ) as TRDParam;
end;

function TRDParamList.Find_by_name(in_object_name: string): TRDParam;
begin
result := inherited Find_by_name(in_object_name) as TRDParam;
end;

function TRDParamList.First_param: TRDParam;
begin
  result := inherited First_item as TRDParam;
end;

function TRDParamList.Get_current_param: TRDParam;
begin
  result := inherited Get_current_item as TRDParam;
end;

function TRDParamList.Last_param: TRDParam;
begin
  result := inherited Last_item as TRDParam;
end;

function TRDParamList.Next_param: TRDParam;
begin
   result := inherited Next_item as TRDParam;
end;

function TRDParamList.Prev_param: TRDParam;
begin
   result := inherited Prev_item as TRDParam;
end;

function TRDParamList.set_current_param(in_param_index: integer): boolean;
begin
  result := inherited set_current_item ( in_param_index );
end;

end.
