1 import Application
2 import ASCP/Service
3 #------------------------------------------------------------------
4 # Class:
5 # ActiveServiceApplication
6 # Description:
7 # Base application class for Active Service application. Defines
8 # options and default arguments for active service.
9 #------------------------------------------------------------------
10 Class ActiveServiceApplication -superclass Application
11
12 ActiveServiceApplication instproc init { argv name } {
13 $self next $argv
14
15 set o [$self options]
16
17 $self init_as_resources $o
18 $self init_as_args $o
19 $o parse_args $argv
20
21 # Run ASCP Protocol, unless user specified "-as_service no"
22 $self instvar ascp_
23 set service_id [$self get_option sid]
24 set as_service [$self get_option as_service]
25 if {$as_service == "yes" && $service_id != ""} {
26 set as_bw [$self get_option as_bw]
27 set as_spec [$self get_option as_spec]
28 set ascp_($service_id) [new ASCP/Service $as_spec $as_bw $service_id]
29 }
30
31 }
32
33 ActiveServiceApplication instproc init_as_args {o} {
34 $o register_option "-as_service" "as_service"
35 $o register_option "-as_spec" "as_spec"
36 $o register_option "-as_bw" "as_bw"
37 $o register_option "-sid" "sid"
38
39 }
40
41
42 ActiveServiceApplication instproc init_as_resources {o} {
43 $o add_default "as_service" "yes"
44 $o add_default "as_spec" 224.4.5.24/50000/1
45 $o add_default "as_bw" 50000
46 $o add_default "sid" ""
47 }
48
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.