00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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:
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 };
00131
00132 #endif // OMNIEVENTS__PROXYMANAGER_H