Home > vbmeg > functions > common > utility > stack > vb_stack_push.m

vb_stack_push

PURPOSE ^

push to stack

SYNOPSIS ^

function [obj] = vb_stack_push(obj, push_data)

DESCRIPTION ^

 push to stack
 [USAGE]
    [obj] = vb_stack_push(<obj>, <pushed_obj>);
 [IN]
          obj : stack object
    push_data : push data into stack.
 [OUT]
    obj : stack object

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [obj] = vb_stack_push(obj, push_data)
0002 % push to stack
0003 % [USAGE]
0004 %    [obj] = vb_stack_push(<obj>, <pushed_obj>);
0005 % [IN]
0006 %          obj : stack object
0007 %    push_data : push data into stack.
0008 % [OUT]
0009 %    obj : stack object
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 %
0015 % --- Previous check
0016 %
0017 if ~exist('obj', 'var'), error('obj is a required parameter.'); end
0018 if ~exist('push_data', 'var')
0019     error('push_data is a required parameter.');
0020 end
0021 
0022 %
0023 % --- Main Procedure
0024 %
0025 switch(obj.class_type)
0026     case 'm_stack'
0027         obj = vb_m_stack_push(obj, push_data);
0028     case 'f_stack'
0029         obj = vb_f_stack_push(obj, push_data);
0030     otherwise
0031         error('Specified obj is invalid.');
0032 end
0033 
0034 %
0035 % --- After check
0036 %
0037 if nargout ~= 1
0038     error('function caller should receive obj.');
0039 end

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005