view m-toolbox/classes/@ssmblock/addPorts.m @ 52:daf4eab1a51e database-connection-manager tip

Fix. Default password should be [] not an empty string
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 07 Dec 2011 17:29:47 +0100
parents f0afece42f48
children
line wrap: on
line source

% ADDPORTS adds the given ssm ports to the list of ports.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% DESCRIPTION: ADDPORTS adds the given ssm ports to the list of ports.
%
% The given ports are added to the list of ports. No check is done to ensure
% the ports remain unique. Instead you should check with
% ssmblock.containsPort before adding the ports.
%
% CALL:            block = addPorts(ssmblocks, ports)
%
% VERSION:     $Id: addPorts.m,v 1.4 2011/04/08 08:56:31 hewitson Exp $
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function varargout = addPorts(varargin)
  warning('This function is outdated and will be deleted')
  [blocks, invars, rest] = utils.helper.collect_objects(varargin(:), 'ssmblock');
  ports = utils.helper.collect_objects(rest, 'ssmport');
  
  % copy or modify
  outblocks = copy(blocks, nargout);
  
  % loop over blocks
  for kk=1:numel(blocks)
    block = blocks(kk);
    block.ports = [block.ports copy(ports,1)];
  end
  
  if nargout > 0
    varargout{1} = outblocks;
  end
end