File: IDEA1

package info (click to toggle)
orbit 0.5.0-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,604 kB
  • ctags: 4,626
  • sloc: ansic: 37,930; sh: 7,508; yacc: 1,750; makefile: 877; lex: 366
file content (46 lines) | stat: -rw-r--r-- 1,427 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<July 6> This feature will wait until we get a full-featured ORB that
talks over the network. I don't think anyone (especially myself) has
enough knowledge to implement it on the first go-round. -ECL

-----------------------------------------------------------------------

Fast way to avoid marshalling at all for calls to stuff in the same
address space:

typedef struct CORBA_Object_struct *CORBA_Object;
struct CORBA_Object_struct {
	void (*release)(CORBA_Object _handle, CORBA_Environment &ev);
};

#define CORBA_Object_release(_handle, evptr) _handle->release(_handle, evptr)

You would do this for all subclasses of an object, too:

typedef struct example_struct *example;
struct example_struct {
	void (*op1)(CORBA_Object _handle, int inparam, CORBA_Environment &ev);
};

#define example_op1(_handle, inparam, evptr) \
	_handle->release(_handle, inparam, evptr)

That is all.

-----------------
Multiple inheritance makes this not-work.

However, we can still have our fun.

gulong CORBA_Object_class_id;
typedef struct CORBA_Object_struct *CORBA_Object;
struct CORBA_Object_struct {
	gpointer *func_lookup_table;
};
typedef struct CORBA_Object_methods *CORBA_Object_methods
struct CORBA_Object_methods {
	void (*release)(CORBA_Object _handle, CORBA_Environment &ev);
};


#define CORBA_Object_release(_handle, evptr) \
((CORBA_Object_methods)_handle->func_lookup_table[CORBA_Object_class_id])->release(_handle, evptr)