2 #include <CORBA-SMALL.h>
3 #ifdef HAVE_ANSI_CPLUSPLUS_HEADERS
14 class tty_impl : virtual public Hello3::tty_skel,
15 virtual public Hello4::ttyplus_skel {
21 tty_impl(char* fname) :f(fname) { ln= 1; max_col= 80; }
22 ~tty_impl() { f.close();}
25 void columns(CORBA::Short n) {
28 CORBA::Short columns(void) {
31 CORBA::Long lines(void) {
35 for (int i= 10; --i>=0; f << endl);
38 void print(const char* msg) {
39 for (int col=0; msg[col]; f << msg[col++]) {
40 if (((col+1) % max_col) == 0) {
44 f << endl; f.flush(); ++ln; }
49 int main(int argc, char* argv[]) {
55 orb= CORBA::ORB_init(argc, argv, "mico-local-orb");
56 boa= orb->BOA_init(argc, argv, "mico-local-boa");
58 // Objekt-Implementation erzeugen
59 obj_impl= new tty_impl("/dev/tty");
61 // Objekt-Referenz (als String) ausgeben
62 cout << "Objekt-Referenz dieser tty-Implementation:" << endl;
63 cout << "\t" << orb->object_to_string(obj_impl) << endl;
66 // Warten auf Klienten
67 boa->impl_is_ready (CORBA::ImplementationDef::_nil());