source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/src/res/main/actor/cas.s3d_actor @ 2196

Revision 2196, 4.9 KB checked in by szirmay, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 Spinor GmbH.
8//   ######### # # #          All rights reserved.
9//  ##   ##########
10//      ##
11//
12///////////////////////////////////////////////////////////////////////////////
13
14// Definition of the CAS (component access shell).
15// The CAS allows to interactively inspect and modify the actors at runtime
16// via a TCP port.
17
18// Encapsulate all actors defining the CAS in an own namespace:
19actor_ident "kit_base.capsule"
20actor_param
21{
22    active 1
23    scope "cas"
24    local_name "capsule"
25    deleg_target ""
26    child_ident "kit_base.group"   
27    child_param                 
28    {
29        // Delegate action calls to the children.
30        active 1
31        child_array
32        {
33            // Producer for CAS objects:
34            ident "kit_base.producer"
35            param
36            {
37                active 1
38                name "connection_producer"
39                deleg_name "connectionset"
40                ident "kit_base.capsule"
41                param
42                {
43                    active 1
44                    scope "cas_connection"
45                    local_name "capsule"
46                    deleg_target "dispatch_export"
47                    child_ident "kit_base.group"
48                    child_param
49                    {
50                        // Delegate action calls to the children.
51                        active 1
52                        child_array
53                        {
54                            // Dispatcher for commands from outside
55                            // the capsule:
56                            ident "kit_base.dispatch"
57                            param
58                            {
59                                name "dispatch_export"
60                                entry_array
61                                {
62                                    // Assign the socket object.
63                                    cmds "set_tcpstream"
64                                    targets "tcpinput"
65                                }
66                            }
67                        }
68                        {
69                            // Dispatcher within the CAS capsule.
70                            ident "kit_base.dispatch"
71                            param
72                            {
73                                name "dispatch"
74                                entry_array
75                                {
76                                    // If the connection is lost or closed,
77                                    // destroy the CAS object.
78                                    cmds "notify_lost" "notify_closed"
79                                    targets "capsule"
80                                    newcmd "destroy"
81                                }
82                            }
83                        }
84                        {
85                            // The CAS shell evaluating commands.
86                            ident "kit_com.shell"
87                            param
88                            {
89                                name "shell"
90                                write_line_cmd "write_line"
91                                quit_cmd "close"
92                                start_actor "^^root"
93                            }
94                        }
95                        {
96                            // CAS socket and line parser:
97                            ident "kit_com.tcpinput"
98                            param
99                            {
100                                name "tcpinput"
101                                extcfg_actor "^^cfg"
102                                extcfg_entry_addrport ""
103                                extcfg_entry_echo "cas.echo"
104                                extcfg_entry_telnet "cas.telnet"
105                                interpreter "shell"
106                                welcome
107                                    "Welcome to the Shark 3D "
108                                    & "component access shell (CAS)."
109                                    "Type 'help' for help."
110                                prompt "Shark3D-CAS> "
111                                notify "dispatch"
112                            }
113                        }
114                    }
115                }
116            }
117        }
118        {
119            // Listen socket waiting for incoming connections:
120            ident "kit_com.tcplisten"
121            param
122            {
123                active 1
124                ignore_socket_errors 1
125                extcfg_actor "^cfg"
126                extcfg_entry_addrport "cas.addrport"
127                producer "connection_producer"
128            }
129        }
130    }
131}
Note: See TracBrowser for help on using the repository browser.