#include <Service_Object.h>
Collaboration diagram for ACE_Service_Type:

Public Types | |
| enum | { DELETE_OBJ = 1, DELETE_THIS = 2 } |
| enum | { SERVICE_OBJECT = ACE_SVC_OBJ_T, MODULE = ACE_MODULE_T, STREAM = ACE_STREAM_T, INVALID_TYPE = -1 } |
Public Member Functions | |
| ACE_Service_Type (const ACE_TCHAR *n, ACE_Service_Type_Impl *o, const ACE_DLL &dll, int active) | |
| ACE_Service_Type (const ACE_TCHAR *n, ACE_Service_Type_Impl *o, ACE_SHLIB_HANDLE handle, int active) | |
| ~ACE_Service_Type (void) | |
| const ACE_TCHAR * | name (void) const |
| void | name (const ACE_TCHAR *) |
| const ACE_Service_Type_Impl * | type (void) const |
| void | type (const ACE_Service_Type_Impl *, int active=1) |
| bool | is_forward_declaration (void) const |
| int | suspend (void) const |
| int | resume (void) const |
| int | active (void) const |
| void | active (int) |
| int | fini (void) |
| Calls on . | |
| int | fini_called (void) const |
| Check if the service has been fini'ed. | |
| void | dump (void) const |
| Dump the state of an object. | |
| const ACE_DLL & | dll () const |
| Get to the DLL's implentation. | |
Public Attributes | |
| ACE_ALLOC_HOOK_DECLARE | |
| Declare the dynamic allocation hooks. | |
Private Attributes | |
| const ACE_TCHAR * | name_ |
| Humanly readible name of svc. | |
| const ACE_Service_Type_Impl * | type_ |
| Pointer to C++ object that implements the svc. | |
| ACE_DLL | dll_ |
| int | active_ |
| 1 if svc is currently active, otherwise 0. | |
| int | fini_already_called_ |
| 1 if on has already been called, otherwise 0. | |
This class acts as the interface of the "Bridge" pattern.
Definition at line 74 of file Service_Object.h.
|
|
Definition at line 77 of file Service_Object.h.
00078 {
00079 /// Delete the payload object.
00080 DELETE_OBJ = 1,
00081
00082 /// Delete the enclosing object.
00083 DELETE_THIS = 2
00084 };
|
|
|
Definition at line 86 of file Service_Object.h.
00087 {
00088 SERVICE_OBJECT = ACE_SVC_OBJ_T,
00089 MODULE = ACE_MODULE_T,
00090 STREAM = ACE_STREAM_T,
00091 INVALID_TYPE = -1
00092 };
|
|
||||||||||||||||||||
|
Definition at line 45 of file Service_Object.cpp. References ACE_TCHAR, ACE_TRACE, and name().
|
|
||||||||||||||||||||
|
Definition at line 59 of file Service_Object.cpp. References ACE_SHLIB_HANDLE, ACE_TCHAR, ACE_TRACE, name(), and ACE_DLL::set_handle().
00063 : name_ (0), 00064 type_ (t), 00065 active_ (active), 00066 fini_already_called_ (0) 00067 { 00068 ACE_TRACE ("ACE_Service_Type::ACE_Service_Type"); 00069 ACE_DLL &dll = const_cast<ACE_DLL &> (this->dll_); 00070 dll.set_handle (handle); 00071 this->name (n); 00072 } |
|
|
Definition at line 74 of file Service_Object.cpp. References ACE_TRACE, and fini().
|
|
|
Definition at line 53 of file Service_Object.inl. References ACE_TRACE.
|
|
|
Definition at line 46 of file Service_Object.inl. References ACE_TRACE. Referenced by ACE_Service_Manager::list_services(), and ACE_Service_Repository_Iterator::valid().
|
|
|
Get to the DLL's implentation.
Definition at line 66 of file Service_Object.inl. References ACE_INLINE. Referenced by ACE_Dynamic_Service_Dependency::init().
00067 {
00068 return this->dll_;
00069 }
|
|
|
Dump the state of an object.
Definition at line 26 of file Service_Object.cpp. References ACE_TRACE, and ACE_OS::fprintf(). Referenced by ACE_Service_Repository::fini(), ACE_Dynamic_Service_Dependency::init(), ACE_Service_Repository::insert(), and ACE_Service_Type_Forward_Declaration_Guard::~ACE_Service_Type_Forward_Declaration_Guard().
00027 {
00028 #if defined (ACE_HAS_DUMP)
00029 ACE_TRACE ("ACE_Service_Type::dump");
00030 #endif /* ACE_HAS_DUMP */
00031
00032
00033 // Using printf, since the log facility may not have
00034 // been initialized yet
00035 ACE_OS::fprintf(stderr,
00036 "// [ST] dump, this=%p, name=%s, type=%p, so=%p, active=%d\n",
00037 this,
00038 this->name_,
00039 this->type_,
00040 (this->type_ != 0) ? this->type_->object () : 0,
00041 this->active_);
00042
00043 }
|
|
|
Calls on .
Definition at line 83 of file Service_Object.cpp. References ACE_Service_Type_Impl::fini(), and fini_already_called_. Referenced by ACE_Service_Repository::fini(), and ~ACE_Service_Type().
00084 {
00085 if (!this->fini_already_called_)
00086 {
00087 this->fini_already_called_ = 1;
00088 if (this->type_ != 0)
00089 return this->type_->fini ();
00090 else
00091 return 1; // No implementation was found.
00092 // Currently only makes sense for dummy ST, used to "reserve"
00093 // a spot (kind of like forward-declarations) for a dynamic
00094 // service. This is necessary to help enforce the correct
00095 // finalization order, when such service also has any
00096 // (dependent) static services
00097 }
00098 return 0;
00099 }
|
|
|
Check if the service has been fini'ed.
Definition at line 60 of file Service_Object.inl. References ACE_TRACE, and fini_already_called_. Referenced by ACE_Service_Repository::find_i().
00061 {
00062 ACE_TRACE ("ACE_Service_Type::fini_called");
00063 return this->fini_already_called_;
00064 }
|
|
|
|
|
|
Definition at line 143 of file Service_Object.cpp. References ACE_TCHAR, ACE_TRACE, and ACE::strnew().
00144 {
00145 ACE_TRACE ("ACE_Service_Type::name");
00146
00147 delete [] const_cast <ACE_TCHAR *> (this->name_);
00148 this->name_ = ACE::strnew (n);
00149 }
|
|
|
Definition at line 24 of file Service_Object.inl. References ACE_TRACE. Referenced by ACE_Service_Type(), ace_yyparse(), ACE_Service_Gestalt::initialize(), ACE_Service_Gestalt::initialize_i(), ACE_Service_Repository::insert(), and ACE_Service_Manager::list_services().
|
|
|
Definition at line 110 of file Service_Object.cpp. References ACE_TRACE, and ACE_Service_Type_Impl::resume(). Referenced by ACE_Service_Repository::resume().
|
|
|
Definition at line 102 of file Service_Object.cpp. References ACE_TRACE, and ACE_Service_Type_Impl::suspend(). Referenced by ACE_Service_Repository::suspend().
|
|
||||||||||||
|
Definition at line 38 of file Service_Object.inl. References ACE_TRACE.
00039 {
00040 ACE_TRACE ("ACE_Service_Type::type");
00041 this->type_ = o;
00042 ((ACE_Service_Type *) this)->active_ = enabled;
00043 }
|
|
|
Definition at line 31 of file Service_Object.inl. References ACE_TRACE. Referenced by ace_get_module(), ace_yyparse(), ACE_Service_Gestalt::initialize(), ACE_Service_Gestalt::initialize_i(), ACE_Dynamic_Service_Base::instance(), ACE_Service_Manager::list_services(), and ACE_Service_Type_Forward_Declaration_Guard::~ACE_Service_Type_Forward_Declaration_Guard().
|
|
|
Declare the dynamic allocation hooks.
Definition at line 132 of file Service_Object.h. |
|
|
1 if svc is currently active, otherwise 0.
Definition at line 146 of file Service_Object.h. |
|
|
ACE_DLL representing the shared object file (non-zero if dynamically linked). Definition at line 143 of file Service_Object.h. |
|
|
1 if on has already been called, otherwise 0.
Definition at line 149 of file Service_Object.h. Referenced by fini(), and fini_called(). |
|
|
Humanly readible name of svc.
Definition at line 136 of file Service_Object.h. |
|
|
Pointer to C++ object that implements the svc.
Definition at line 139 of file Service_Object.h. |
1.3.6