orb.H

00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and
00008  * its documentation under the terms of the GNU General Public License is
00009  * hereby granted. No representations are made about the suitability of
00010  * this software for any purpose. It is provided "as is" without express
00011  * or implied warranty. See the GNU General Public License
00012  * (http://www.gnu.org/copyleft/gpl.html) for more details.
00013  *
00014  * The characters in this file are ISO8859-1 encoded.
00015  *
00016  * The documentation in this file is in "Doxygen" style
00017  * (http://www.doxygen.org).
00018  */
00019 #ifndef ARCHON_X3D_SAI_ORB_H
00020 #define ARCHON_X3D_SAI_ORB_H
00021 
00022 #include <omniORB4/CORBA.h>
00023 
00024 #include <archon/util/thread.H>
00025 
00026 
00027 namespace Archon
00028 {
00029   namespace X3D
00030   {
00031     namespace SAI
00032     {
00033       using namespace Utilities;
00034 
00035       struct Orb
00036       {
00037         Orb(int port=-1);
00038         ~Orb();
00039 
00040         CORBA::ORB_var &getCorbaOrb()     { return orb; }
00041         PortableServer::POA_var &getPoa() { return poa; }
00042 
00043       private:
00044         CORBA::ORB_var orb;
00045         PortableServer::POA_var poa;
00046       };
00047 
00048       template<typename T>
00049       struct ServantRef
00050       {
00051         ServantRef(T *p): p(p) {}
00052         ~ServantRef() { p->_remove_ref(); }
00053         T *operator->() { return p; }
00054         T *get() const { return p; }
00055       private:
00056         T *p;
00057       };
00058     }
00059   }
00060 }
00061 
00062 #endif // ARCHON_X3D_SAI_ORB_H

Generated on Sun Jul 30 22:55:47 2006 for Archon by  doxygen 1.4.4