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/Abstract_Servant_Base.h"
00026 #include "ace/Atomic_Op.h"
00027
00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00029
00030 class TAO_Operation_Table;
00031
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 class TAO_PortableServer_Export TAO_ServantBase
00061 : public virtual TAO_Abstract_ServantBase
00062 {
00063 public:
00064
00065
00066 virtual ~TAO_ServantBase (void);
00067
00068
00069 virtual PortableServer::POA_ptr _default_POA (
00070 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
00071 );
00072
00073
00074 virtual CORBA::Boolean _is_a (const char *logical_type_id
00075 ACE_ENV_ARG_DECL_WITH_DEFAULTS);
00076
00077
00078 virtual CORBA::Boolean _non_existent (
00079 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
00080 );
00081
00082
00083 virtual CORBA::InterfaceDef_ptr _get_interface (
00084 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
00085 );
00086
00087
00088 virtual CORBA::Object_ptr _get_component (
00089 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
00090 );
00091
00092
00093 virtual char * _repository_id (
00094 ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
00095 );
00096
00097
00098 virtual TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL);
00099
00100
00101
00102
00103
00104
00105
00106
00107 virtual void _dispatch (TAO_ServerRequest &request,
00108 void *servant_upcall
00109 ACE_ENV_ARG_DECL) = 0;
00110
00111
00112
00113 virtual int _find (const char *opname,
00114 TAO_Skeleton &skelfunc,
00115 const size_t length = 0);
00116
00117 virtual int _find (const char *opname,
00118 TAO_Collocated_Skeleton &skelfunc,
00119 TAO::Collocation_Strategy st,
00120 const size_t length = 0);
00121
00122
00123 virtual const char *_interface_repository_id (void) const = 0;
00124
00125
00126
00127
00128
00129
00130 virtual void _add_ref (ACE_ENV_SINGLE_ARG_DECL);
00131
00132
00133
00134
00135
00136
00137 virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
00138
00139
00140
00141
00142 virtual CORBA::ULong _refcount_value (ACE_ENV_SINGLE_ARG_DECL) const;
00143
00144
00145 protected:
00146
00147
00148 TAO_ServantBase (void);
00149
00150
00151 TAO_ServantBase (const TAO_ServantBase &);
00152
00153
00154 TAO_ServantBase &operator= (const TAO_ServantBase &);
00155
00156 virtual void synchronous_upcall_dispatch (TAO_ServerRequest & req,
00157 void * servant_upcall,
00158 void * derived_this
00159 ACE_ENV_ARG_DECL);
00160
00161 virtual void asynchronous_upcall_dispatch (TAO_ServerRequest & req,
00162 void * servant_upcall,
00163 void * derived_this
00164 ACE_ENV_ARG_DECL);
00165
00166 protected:
00167
00168 ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> ref_count_;
00169
00170
00171
00172 TAO_Operation_Table * optable_;
00173 };
00174
00175 class TAO_PortableServer_Export TAO_Servant_Hash
00176 {
00177 public:
00178
00179 u_long operator () (PortableServer::Servant servant) const;
00180 };
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192 class TAO_PortableServer_Export TAO_ServantBase_var
00193 {
00194 public:
00195 TAO_ServantBase_var (void);
00196
00197 TAO_ServantBase_var (TAO_ServantBase *p);
00198
00199 TAO_ServantBase_var (const TAO_ServantBase_var &b);
00200
00201 ~TAO_ServantBase_var (void);
00202
00203 TAO_ServantBase_var &operator= (TAO_ServantBase *p);
00204
00205 TAO_ServantBase_var &operator= (const TAO_ServantBase_var &b);
00206
00207 TAO_ServantBase *operator-> () const;
00208
00209 TAO_ServantBase *in (void) const;
00210
00211 TAO_ServantBase *&inout (void);
00212
00213 TAO_ServantBase *&out (void);
00214
00215 TAO_ServantBase *_retn (void);
00216
00217 private:
00218
00219 TAO_ServantBase *ptr_;
00220 };
00221
00222 TAO_END_VERSIONED_NAMESPACE_DECL
00223
00224 #if defined (__ACE_INLINE__)
00225 # include "tao/PortableServer/Servant_Base.i"
00226 #endif
00227
00228 #include "ace/post.h"
00229
00230 #endif