Servant.h

Go to the documentation of this file.
00001 //                            Package   : omniEvents
00002 // Servant.h                  Created   : 2003/12/04
00003 //                            Author    : Alex Tingle
00004 //
00005 //    Copyright (C) 2003 Alex Tingle.
00006 //
00007 //    This file is part of the omniEvents application.
00008 //
00009 //    omniEvents is free software; you can redistribute it and/or
00010 //    modify it under the terms of the GNU Lesser General Public
00011 //    License as published by the Free Software Foundation; either
00012 //    version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //    omniEvents is distributed in the hope that it will be useful,
00015 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //    Lesser General Public License for more details.
00018 //
00019 //    You should have received a copy of the GNU Lesser General Public
00020 //    License along with this library; if not, write to the Free Software
00021 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 
00024 #ifndef OMNIEVENTS__SERVANT_H
00025 #define OMNIEVENTS__SERVANT_H
00026 
00027 #ifdef HAVE_CONFIG_H
00028 #  include "config.h"
00029 #endif
00030 
00031 #ifdef HAVE_OMNIORB3
00032 #  include <omniORB3/CORBA.h>
00033 #endif
00034 
00035 #ifdef HAVE_OMNIORB4
00036 #  include <omniORB4/CORBA.h>
00037 #endif
00038 
00039 
00040 namespace OmniEvents {
00041 
00048 CORBA::Object_ptr
00049 createReference(PortableServer::POA_ptr poa, const char* repositoryId);
00050 
00060 template<class T>
00061 typename T::_ptr_type
00062 createNarrowedReference(PortableServer::POA_ptr poa, const char* repositoryId)
00063 {
00064   CORBA::Object_var obj =createReference(poa,repositoryId);
00065 #ifdef HAVE_OMNIORB4
00066   return T::_unchecked_narrow(obj.in());
00067 #else
00068   return T::_narrow(obj.in());
00069 #endif
00070 }
00071 
00073 char* newUniqueId();
00074 
00075 
00079 class Servant : public virtual PortableServer::ServantBase
00080 {
00081 public:
00082   virtual PortableServer::POA_ptr _default_POA();
00083   virtual ~Servant();
00084 
00085 protected:
00086   Servant(PortableServer::POA_ptr poa);
00087 
00089   void activateObjectWithId(const char* oidStr);
00091   void deactivateObject();
00092 
00093   PortableServer::POA_var _poa;
00094 
00095 private:
00097   Servant();
00098 };
00099 
00100 }; // end namespace OmniEvents
00101 
00102 #endif // OMNIEVENTS__SERVANT_H

Generated on Mon Jan 9 03:52:14 2006 for OmniEvents by  doxygen 1.4.6