OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / doc / mico / examples / services / relship / DocumentsServer.cc
1 /*
2  *  Demo of COSS Relationship Service
3  *  Copyright (C) 1998 Karel Gardas
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *  Send comments and/or bug reports to:
20  *                 mico@informatik.uni-frankfurt.de
21  *  or to my private e-mail:
22  *                 gardask@alpha.inf.upol.cz
23  */
24
25
26 #include "Documents.h"
27 #include "Documents_impl.h"
28 #ifdef HAVE_ANSI_CPLUSPLUS_HEADERS
29 #include <iostream>
30 #include <fstream>
31 #else
32 #include <iostream.h>
33 #include <fstream.h>
34 #endif
35 #include <unistd.h>
36
37 #define DEBUG 0
38
39 int main( int argc, char *argv[] )
40 {
41   CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "mico-local-orb" );
42  
43   CORBA::Object_var poaobj = orb->resolve_initial_references ("RootPOA");
44   PortableServer::POA_var poa = PortableServer::POA::_narrow (poaobj);
45   PortableServer::POAManager_var mgr = poa->the_POAManager();
46  
47   FigureFactory_impl* ff = new FigureFactory_impl;
48   POA_Documents::FigureFactory_tie<FigureFactory_impl>* fig_tie 
49     = new POA_Documents::FigureFactory_tie<FigureFactory_impl> (*ff);
50
51   TextFactory_impl* tf = new TextFactory_impl;
52   POA_Documents::TextFactory_tie<TextFactory_impl>* text_tie
53     = new POA_Documents::TextFactory_tie<TextFactory_impl> (*tf);
54  
55   poa->activate_object (fig_tie);
56   poa->activate_object (text_tie);
57
58   mgr->activate ();
59
60   orb->run ();
61 #if DEBUG
62   cout << "  <FigureServer> END!\n";
63 #endif
64   return 0;
65 }
66
67
68
69
70