1 # mob-hub.tcl --
2 #
3 # A hub is a special kind of node in mob graph that represents
4 # connections to a group of nodes.
5 #
6 # Copyright (c) 1996-2002 The Regents of the University of California.
7 # All rights reserved.
8 #
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions are met:
11 #
12 # A. Redistributions of source code must retain the above copyright notice,
13 # this list of conditions and the following disclaimer.
14 # B. Redistributions in binary form must reproduce the above copyright notice,
15 # this list of conditions and the following disclaimer in the documentation
16 # and/or other materials provided with the distribution.
17 # C. Neither the names of the copyright holders nor the names of its
18 # contributors may be used to endorse or promote products derived from this
19 # software without specific prior written permission.
20 #
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
22 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 # ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
25 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #
32 # @(#) $Header: /usr/mash/src/repository/mash/mash-1/tcl/indiva/imgr/mob-hub.tcl,v 1.2 2002/05/01 17:03:42 weitsang Exp $
33 #-
34 # Class:
35 # MobHub
36 # Description:
37 # MobHub is a dummy node that does not correspond to any media
38 # object in the namespace. The purpose of a dummy node is to
39 # reduce the number of edges in a complete bipartite graph (V,V')
40 # from n*m to (n+m). We link all edges in V to the dummy node,
41 # and link the dummy node to all edges in V'.
42 #
43 import Mob
44 Class MobHub -superclass Mob
45
46 MobHub set id_ 0
47 MobHub instproc init { } {
48 MobHub instvar id_
49 $self next hub$id_
50 incr id_
51 }
52
53 MobHub proc get_ext {} {
54 return ""
55 }
56 MobHub public get_type {} {
57 return "hub"
58 }
59 MobHub public share_readable {} {
60 return 1
61 }
62 MobHub public share_writable {} {
63 return 1
64 }
65 MobHub proc is_hub {name} {
66 return [string match hub* $name]
67 }
68
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.