corba.js 0.1.20 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -14
- package/lib/idl/idl.cjs +1123 -1262
- package/lib/idl/idl.cjs.map +1 -1
- package/lib/idl/src/idl/cc/typeIDLtoCC.d.ts +4 -2
- package/lib/idl/src/idl/cc/typeIDLtoGIOPCC.d.ts +2 -2
- package/lib/idl/src/idl/cc/write-code.d.ts +2 -2
- package/lib/idl/src/idl/cc/write-interface.d.ts +4 -4
- package/lib/idl/src/idl/cc/write-skeleton.d.ts +2 -2
- package/lib/idl/src/idl/cc/write-stub.d.ts +2 -2
- package/lib/idl/src/idl/idl-lexer.d.ts +9 -4
- package/lib/idl/src/idl/idl-node.d.ts +157 -27
- package/lib/idl/src/idl/idl-parser.d.ts +2 -2
- package/lib/idl/src/idl/ts/typeIDLtoGIOPTS.d.ts +2 -2
- package/lib/idl/src/idl/ts/typeIDLtoTS.d.ts +3 -2
- package/lib/idl/src/idl/ts/write-interface.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-skeleton.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-stub.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-value.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-valueimpl.d.ts +2 -2
- package/lib/idl/src/idl/ts/write-valuetype.d.ts +2 -2
- package/lib/idl/src/idl/util.d.ts +11 -4
- package/lib/src/idl/cc/typeIDLtoCC.d.ts +4 -2
- package/lib/src/idl/cc/typeIDLtoCC.js +32 -29
- package/lib/src/idl/cc/typeIDLtoCC.js.map +1 -1
- package/lib/src/idl/cc/typeIDLtoGIOPCC.d.ts +2 -2
- package/lib/src/idl/cc/typeIDLtoGIOPCC.js +15 -19
- package/lib/src/idl/cc/typeIDLtoGIOPCC.js.map +1 -1
- package/lib/src/idl/cc/write-code.d.ts +2 -2
- package/lib/src/idl/cc/write-code.js +43 -70
- package/lib/src/idl/cc/write-code.js.map +1 -1
- package/lib/src/idl/cc/write-interface.d.ts +4 -4
- package/lib/src/idl/cc/write-interface.js +64 -65
- package/lib/src/idl/cc/write-interface.js.map +1 -1
- package/lib/src/idl/cc/write-skeleton.d.ts +2 -2
- package/lib/src/idl/cc/write-skeleton.js +6 -7
- package/lib/src/idl/cc/write-skeleton.js.map +1 -1
- package/lib/src/idl/cc/write-stub.d.ts +2 -2
- package/lib/src/idl/cc/write-stub.js +17 -26
- package/lib/src/idl/cc/write-stub.js.map +1 -1
- package/lib/src/idl/idl-lexer.d.ts +9 -4
- package/lib/src/idl/idl-lexer.js +124 -76
- package/lib/src/idl/idl-lexer.js.map +1 -1
- package/lib/src/idl/idl-node.d.ts +157 -27
- package/lib/src/idl/idl-node.js +12 -140
- package/lib/src/idl/idl-node.js.map +1 -1
- package/lib/src/idl/idl-parser.d.ts +2 -2
- package/lib/src/idl/idl-parser.js +426 -450
- package/lib/src/idl/idl-parser.js.map +1 -1
- package/lib/src/idl/idl.js +0 -2
- package/lib/src/idl/idl.js.map +1 -1
- package/lib/src/idl/ts/typeIDLtoGIOPTS.d.ts +2 -2
- package/lib/src/idl/ts/typeIDLtoGIOPTS.js +22 -18
- package/lib/src/idl/ts/typeIDLtoGIOPTS.js.map +1 -1
- package/lib/src/idl/ts/typeIDLtoTS.d.ts +3 -2
- package/lib/src/idl/ts/typeIDLtoTS.js +73 -66
- package/lib/src/idl/ts/typeIDLtoTS.js.map +1 -1
- package/lib/src/idl/ts/write-interface.d.ts +2 -2
- package/lib/src/idl/ts/write-interface.js +89 -90
- package/lib/src/idl/ts/write-interface.js.map +1 -1
- package/lib/src/idl/ts/write-skeleton.d.ts +2 -2
- package/lib/src/idl/ts/write-skeleton.js +24 -33
- package/lib/src/idl/ts/write-skeleton.js.map +1 -1
- package/lib/src/idl/ts/write-stub.d.ts +2 -2
- package/lib/src/idl/ts/write-stub.js +26 -35
- package/lib/src/idl/ts/write-stub.js.map +1 -1
- package/lib/src/idl/ts/write-value.d.ts +2 -2
- package/lib/src/idl/ts/write-value.js +39 -59
- package/lib/src/idl/ts/write-value.js.map +1 -1
- package/lib/src/idl/ts/write-valueimpl.d.ts +2 -2
- package/lib/src/idl/ts/write-valueimpl.js +33 -50
- package/lib/src/idl/ts/write-valueimpl.js.map +1 -1
- package/lib/src/idl/ts/write-valuetype.d.ts +2 -2
- package/lib/src/idl/ts/write-valuetype.js +20 -29
- package/lib/src/idl/ts/write-valuetype.js.map +1 -1
- package/lib/src/idl/util.d.ts +11 -4
- package/lib/src/idl/util.js +71 -12
- package/lib/src/idl/util.js.map +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -68,17 +68,18 @@ the clients an object of type _Client_, which are to be defined in an IDL file:
|
|
|
68
68
|
(`out` and `inout` are not implemented by corba.js)
|
|
69
69
|
|
|
70
70
|
For each interface, the IDL compiler will generate stub and skeleton
|
|
71
|
-
classes
|
|
71
|
+
classes. They are named after the interface with a `_stub` or `_skel` suffix,
|
|
72
|
+
as in the C++ mapping, so for an interface `Server`:
|
|
72
73
|
|
|
73
|
-
* the stub class represents the remote object as if it is a
|
|
74
|
-
within your program
|
|
75
|
-
* the skeleton class is the super class of the interface's
|
|
76
|
-
you will need to provide
|
|
74
|
+
* the stub class `Server_stub` represents the remote object as if it is a
|
|
75
|
+
local object within your program
|
|
76
|
+
* the skeleton class `Server_skel` is the super class of the interface's
|
|
77
|
+
implementation you will need to provide
|
|
77
78
|
|
|
78
79
|
Here are example implementations for the client and server defined earlier:
|
|
79
80
|
|
|
80
81
|
```javascript
|
|
81
|
-
class Client_impl extends
|
|
82
|
+
class Client_impl extends Client_skel {
|
|
82
83
|
constructor(orb: ORB) {
|
|
83
84
|
super(orb)
|
|
84
85
|
}
|
|
@@ -88,7 +89,7 @@ Here are example implementations for the client and server defined earlier:
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
class Server_impl extends
|
|
92
|
+
class Server_impl extends Server_skel {
|
|
92
93
|
clients: Array<Client>
|
|
93
94
|
|
|
94
95
|
constructor(orb: ORB) {
|
|
@@ -96,7 +97,7 @@ Here are example implementations for the client and server defined earlier:
|
|
|
96
97
|
this.clients = new Array<Client>()
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
async registerClient(client:
|
|
100
|
+
async registerClient(client: Client_stub) {
|
|
100
101
|
clients.push(client)
|
|
101
102
|
}
|
|
102
103
|
|
|
@@ -123,7 +124,7 @@ The server side initialization:
|
|
|
123
124
|
|
|
124
125
|
// for the server, the client is a remote object,
|
|
125
126
|
// so we need to register the client's stub
|
|
126
|
-
orb.registerStubClass(
|
|
127
|
+
orb.registerStubClass(Client_stub)
|
|
127
128
|
|
|
128
129
|
// listen for incoming WebSocket connections
|
|
129
130
|
const protocol = new WsProtocol()
|
|
@@ -141,13 +142,13 @@ The client side initialization:
|
|
|
141
142
|
|
|
142
143
|
// for the client, the server is a remote object,
|
|
143
144
|
// so we need to register the server's stub
|
|
144
|
-
orb.registerStubClass(
|
|
145
|
+
orb.registerStubClass(Server_stub)
|
|
145
146
|
|
|
146
147
|
// find the object registered as "MyServer"
|
|
147
148
|
const object = orb.stringToObject("corbaname::localhost:8809#MyServer")
|
|
148
149
|
|
|
149
|
-
// try to cast it to type
|
|
150
|
-
let server =
|
|
150
|
+
// try to cast it to type Server_stub
|
|
151
|
+
let server = Server_stub.narrow(object)
|
|
151
152
|
|
|
152
153
|
// we also want the server to call us thru our Client object
|
|
153
154
|
let me = new Client_impl(orb)
|
|
@@ -181,7 +182,7 @@ made the object publicly accessible via
|
|
|
181
182
|
```
|
|
182
183
|
and the side using the remote object gained access to it via
|
|
183
184
|
```javascript
|
|
184
|
-
const server =
|
|
185
|
+
const server = Server_stub.narrow(
|
|
185
186
|
await orb.stringToObject("corbaname::localhost:2809#MyServer")
|
|
186
187
|
)
|
|
187
188
|
```
|
|
@@ -205,7 +206,7 @@ boolean | boolean
|
|
|
205
206
|
octet, short, long float, double | number
|
|
206
207
|
char, string | string
|
|
207
208
|
sequence<T> | Array<T>
|
|
208
|
-
interface T |
|
|
209
|
+
interface T | T_skel, T_stub
|
|
209
210
|
|
|
210
211
|
While IDL interfaces are used to provide communication between objects
|
|
211
212
|
registered at different ORBs, valuetypes can be used to exchange data
|