Added class templates
This commit is contained in:
27
modules/matlab/generator/templates/template_class_base.m
Normal file
27
modules/matlab/generator/templates/template_class_base.m
Normal file
@@ -0,0 +1,27 @@
|
||||
% {{class.name | upper}}
|
||||
% Matlab handle class for OpenCV object classes
|
||||
classdef {{class.name}} < handle
|
||||
properties (SetAccess = private, Hidden = true)
|
||||
ptr_ = 0; % handle to the underlying c++ class instance
|
||||
end
|
||||
|
||||
methods
|
||||
% constructor
|
||||
function this = {{class.name}}(varargin)
|
||||
this.ptr_ = {{class.name}}Bridge('new', varargin{:});
|
||||
end
|
||||
|
||||
% destructor
|
||||
function delete(this)
|
||||
{{className}}Bridge(this.ptr_, 'delete');
|
||||
end
|
||||
|
||||
{% for function in class.functions %}
|
||||
% {{function.__str__()}}
|
||||
function varargout = {{function.name}}(this, varargin)
|
||||
[varargout{1:nargout}] = {{class.name}}Bridge('{{function.name}}', this.ptr_, varargin{:});
|
||||
end
|
||||
|
||||
{% endfor %}
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user