source: MML/trunk/applications/database/mym/dbm/@BasicDB/display.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1function display(a_f, varargin)
2
3preamble = [];
4if nargin>1
5  idx = find(strcmp(varargin, 'PREAMBLE'));
6  if ~isempty(idx)
7    preamble = varargin{idx+1};
8  end
9end
10
11only_id = false;
12if nargin>1
13  only_id = any(find(strcmp(varargin, 'ONLY_ID')));
14end
15
16if ~only_id
17  display([preamble 'class         : ' class(a_f)])
18  if isempty(a_f)
19    display([preamble 'connection ID : disconnected' ])
20    return
21  end
22  display([preamble 'connection ID : ' num2str(a_f.conInfo.id)])
23  display([preamble 'current table : ' a_f.ctx.collection])
24  display([preamble 'item mYm tag  : ' a_f.ctx.itemRepresentation])
25  display([preamble 'read only     : ' num2str(a_f.ctx.readonly)])
26  display([preamble '#parents      : ' num2str(a_f.ctx.nParents)])
27  fprintf([preamble 'parent ID     :'])
28  for i = 1:a_f.ctx.nParents
29    display(a_f.ctx.parent{i}, 'PREAMBLE', ' ', 'ONLY_ID')
30  end
31  fprintf('\n')
32else
33  if isempty(a_f)
34    fprintf([preamble 'disconnected'])
35    return
36  end
37  fprintf([preamble num2str(a_f.conInfo.id)])
38  if a_f.ctx.nParents>0
39    fprintf('(')
40    for i = 1:a_f.ctx.nParents
41      display(a_f.ctx.parent{i}, 'PREAMBLE', ' ', 'ONLY_ID')
42    end
43    fprintf(')')
44  end
45end
46
47
Note: See TracBrowser for help on using the repository browser.