ProxyManager.h

Go to the documentation of this file.
00001 //                            Package   : omniEvents
00002 // ProxyManager.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__PROXYMANAGER_H
00025 #define OMNIEVENTS__PROXYMANAGER_H
00026 
00027 #ifdef HAVE_CONFIG_H
00028 #  include "config.h"
00029 #endif
00030 
00031 #include <set>
00032 #include <string>
00033 
00034 #ifdef HAVE_IOSTREAM
00035 #  include <iostream>
00036 #else
00037 #  include <iostream.h>
00038 #endif
00039 
00040 #include "Servant.h"
00041 
00042 #ifdef HAVE_STD_IOSTREAM
00043 using namespace std;
00044 #endif
00045 
00046 namespace OmniEvents {
00047 
00048 class Proxy;
00049 class PersistNode;
00050 
00057 class ProxyManager
00058 : public virtual POA_PortableServer::ServantActivator,
00059   public Servant
00060 {
00061 public: // CORBA interface methods
00063   void etherealize(
00064     const PortableServer::ObjectId& oid,
00065     PortableServer::POA_ptr         adapter,
00066     PortableServer::Servant         serv,
00067     CORBA::Boolean                  cleanup_in_progress,
00068     CORBA::Boolean                  remaining_activations
00069   );
00070 
00071 public:
00073   void reincarnate(const PersistNode& node);
00075   void output(ostream& os);
00076 
00077 protected:
00082   ProxyManager(PortableServer::POA_ptr poa, const char* name);
00083   virtual ~ProxyManager();
00084 
00086   set<Proxy*>             _servants;
00091   PortableServer::POA_var _managedPoa;
00092 };
00093 
00094 
00100 class Proxy
00101 : public virtual PortableServer::ServantBase,
00102   public Servant
00103 {
00104 public:
00105   virtual ~Proxy();
00107   virtual void reincarnate(const string& oid, const PersistNode& node)=0;
00109   virtual void output(ostream &os)=0;
00110 protected:
00111   Proxy(PortableServer::POA_ptr poa);
00112 
00114   void keyOutput(ostream& os, const char* name);
00116   void eraseKey(const char* name);
00118   void basicOutput(
00119     ostream& os, const char* name,
00120     CORBA::Object_ptr target=CORBA::Object::_nil(),
00121     const char* extraAttributes=NULL
00122   );
00123  
00124   CORBA::Request_var _req;
00125 private:
00126   Proxy(const Proxy&); 
00127 };
00128 
00129 
00130 }; // end namespace OmniEvents
00131 
00132 #endif // OMNIEVENTS__PROXYMANAGER_H

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