00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef TAO_SERVANT_BASE_H
00014 #define TAO_SERVANT_BASE_H
00015
00016 #include "ace/pre.h"
00017
00018 #include "tao/PortableServer/portableserver_export.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif
00023
00024 #include "tao/PortableServer/PS_ForwardC.h"
00025 #include "tao/PortableServer/Servant_var.h"
00026 #include "tao/Abstract_Servant_Base.h"
00027 #include "ace/Atomic_Op.h"
00028
00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00030
00031 class TAO_Operation_Table;
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 class TAO_PortableServer_Export TAO_ServantBase
00062 : public virtual TAO_Abstract_ServantBase
00063 {
00064 public:
00065
00066
00067 virtual ~TAO_ServantBase (void);
00068
00069
00070 virtual PortableServer::POA_ptr _default_POA (void);
00071
00072
00073 virtual CORBA::Boolean _is_a (const char *logical_type_id);
00074
00075
00076 virtual CORBA::Boolean _non_existent (void);
00077
00078
00079 virtual CORBA::InterfaceDef_ptr _get_interface (void);
00080
00081
00082 virtual CORBA::Object_ptr _get_component (void);
00083
00084
00085 virtual char * _repository_id (void);
00086
00087
00088 virtual TAO_Stub *_create_stub (void);
00089
00090
00091
00092
00093
00094
00095
00096
00097 virtual void _dispatch (TAO_ServerRequest &request, void *servant_upcall) = 0;
00098
00099
00100
00101 virtual int _find (const char *opname,
00102 TAO_Skeleton &skelfunc,
00103 const size_t length = 0);
00104
00105 virtual int _find (const char *opname,
00106 TAO_Collocated_Skeleton &skelfunc,
00107 TAO::Collocation_Strategy st,
00108 const size_t length = 0);
00109
00110
00111 virtual const char *_interface_repository_id (void) const = 0;
00112
00113
00114
00115
00116
00117
00118 virtual void _add_ref (void);
00119
00120
00121
00122
00123
00124
00125 virtual void _remove_ref (void);
00126
00127
00128
00129
00130 virtual CORBA::ULong _refcount_value (void) const;
00131
00132
00133 protected:
00134
00135
00136 TAO_ServantBase (void);
00137
00138
00139 TAO_ServantBase (const TAO_ServantBase &);
00140
00141
00142 TAO_ServantBase &operator= (const TAO_ServantBase &);
00143
00144 virtual void synchronous_upcall_dispatch (TAO_ServerRequest & req,
00145 void * servant_upcall,
00146 void * derived_this);
00147
00148 virtual void asynchronous_upcall_dispatch (TAO_ServerRequest & req,
00149 void * servant_upcall,
00150 void * derived_this);
00151
00152 protected:
00153
00154 ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> ref_count_;
00155
00156
00157
00158 TAO_Operation_Table * optable_;
00159 };
00160
00161 class TAO_PortableServer_Export TAO_Servant_Hash
00162 {
00163 public:
00164
00165 u_long operator () (PortableServer::Servant servant) const;
00166 };
00167
00168 namespace PortableServer
00169 {
00170 typedef Servant_var<TAO_ServantBase> ServantBase_var;
00171 }
00172
00173 TAO_END_VERSIONED_NAMESPACE_DECL
00174
00175 #if defined (__ACE_INLINE__)
00176 # include "tao/PortableServer/Servant_Base.inl"
00177 #endif
00178
00179 #include "ace/post.h"
00180
00181 #endif