Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Service_Type Class Reference

Keeps track of information related to the various <ACE_Service_Type_Impl> subclasses. More...

#include <Service_Object.h>

Collaboration diagram for ACE_Service_Type:

Collaboration graph
[legend]
List of all members.

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 Methods

 ACE_Service_Type (const ACE_TCHAR *n, ACE_Service_Type_Impl *o, const ACE_DLL &dll, int active)
 ~ACE_Service_Type (void)
const ACE_TCHARname (void) const
void name (const ACE_TCHAR *)
const ACE_Service_Type_Impltype (void) const
void type (const ACE_Service_Type_Impl *, int active=1)
int suspend (void) const
int resume (void) const
int active (void) const
void active (int)
int fini (void)
 Calls <fini> on <type_>. More...

int fini_called (void) const
 Check if the service has been fini'ed. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

const ACE_TCHARname_
 Humanly readible name of svc. More...

const ACE_Service_Type_Impltype_
 Pointer to C++ object that implements the svc. More...

ACE_DLL dll_
 ACE_DLL representing the shared object file (non-zero if dynamically linked). More...

int active_
 1 if svc is currently active, otherwise 0. More...

int fini_already_called_
 1 if <fini> on <type_> has already been called, otherwise 0. More...


Detailed Description

Keeps track of information related to the various <ACE_Service_Type_Impl> subclasses.

This class acts as the interface of the "Bridge" pattern.

Definition at line 68 of file Service_Object.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
DELETE_OBJ  Delete the payload object.
DELETE_THIS  Delete the enclosing object.

Definition at line 71 of file Service_Object.h.

00072   {
00073     /// Delete the payload object.
00074     DELETE_OBJ = 1,
00075 
00076     /// Delete the enclosing object.
00077     DELETE_THIS = 2
00078   };

anonymous enum
 

Enumeration values:
SERVICE_OBJECT 
MODULE 
STREAM 
INVALID_TYPE 

Definition at line 80 of file Service_Object.h.

00081     {
00082       SERVICE_OBJECT = ACE_SVC_OBJ_T,
00083       MODULE = ACE_MODULE_T,
00084       STREAM = ACE_STREAM_T,
00085       INVALID_TYPE = -1
00086     };


Constructor & Destructor Documentation

ACE_Service_Type::ACE_Service_Type const ACE_TCHAR   n,
ACE_Service_Type_Impl   o,
const ACE_DLL   dll,
int    active
 

Definition at line 24 of file Service_Object.cpp.

References ACE_TCHAR, ACE_TRACE, and name.

00028   : name_ (0),
00029     type_ (t),
00030     dll_ (dll),
00031     active_ (active),
00032     fini_already_called_ (0)
00033 {
00034   ACE_TRACE ("ACE_Service_Type::ACE_Service_Type");
00035   this->name (n);
00036 }

ACE_Service_Type::~ACE_Service_Type void   
 

Definition at line 38 of file Service_Object.cpp.

References ACE_TCHAR, ACE_TRACE, fini, and name_.

00039 {
00040   ACE_TRACE ("ACE_Service_Type::~ACE_Service_Type");
00041 
00042   this->fini ();
00043 
00044   delete [] (ACE_TCHAR *) this->name_;
00045 }


Member Function Documentation

ACE_INLINE void ACE_Service_Type::active int   
 

Definition at line 53 of file Service_Object.i.

References ACE_TRACE, and active_.

00054 {
00055   ACE_TRACE ("ACE_Service_Type::active");
00056   this->active_ = turnon;
00057 }

ACE_INLINE int ACE_Service_Type::active void    const
 

Definition at line 46 of file Service_Object.i.

References ACE_TRACE, and active_.

Referenced by ACE_Service_Repository::find_i, ACE_Service_Config::initialize, and ACE_Service_Manager::list_services.

00047 {
00048   ACE_TRACE ("ACE_Service_Type::active");
00049   return this->active_ != 0;
00050 }

void ACE_Service_Type::dump void    const
 

Dump the state of an object.

Definition at line 19 of file Service_Object.cpp.

References ACE_TRACE.

00020 {
00021   ACE_TRACE ("ACE_Service_Type::dump");
00022 }

int ACE_Service_Type::fini void   
 

Calls <fini> on <type_>.

Definition at line 48 of file Service_Object.cpp.

References ACE_Service_Type_Impl::fini, fini_already_called_, and type_.

Referenced by ACE_Service_Repository::fini, and ~ACE_Service_Type.

00049 {
00050   if (!this->fini_already_called_)
00051     {
00052       this->fini_already_called_ = 1;
00053       return this->type_->fini ();
00054     }
00055   return 0;
00056 }

ACE_INLINE int ACE_Service_Type::fini_called void    const
 

Check if the service has been fini'ed.

Definition at line 60 of file Service_Object.i.

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 }

void ACE_Service_Type::name const ACE_TCHAR  
 

Definition at line 100 of file Service_Object.cpp.

References ACE_TCHAR, ACE_TRACE, name_, and ACE::strnew.

00101 {
00102   ACE_TRACE ("ACE_Service_Type::name");
00103 
00104   delete [] (ACE_TCHAR *) this->name_;
00105   this->name_ = ACE::strnew (n);
00106 }

ACE_INLINE const ACE_TCHAR * ACE_Service_Type::name void    const
 

Definition at line 24 of file Service_Object.i.

References ACE_TRACE, and name_.

Referenced by ACE_Service_Type, ACE_Service_Config::initialize, ACE_Service_Repository::insert, and ACE_Service_Manager::list_services.

00025 {
00026   ACE_TRACE ("ACE_Service_Type::name");
00027   return this->name_;
00028 }

int ACE_Service_Type::resume void    const
 

Definition at line 67 of file Service_Object.cpp.

References ACE_TRACE, ACE_Service_Type_Impl::resume, and type_.

Referenced by ACE_Service_Repository::resume.

00068 {
00069   ACE_TRACE ("ACE_Service_Type::resume");
00070   ((ACE_Service_Type *) this)->active_ = 1;
00071   return this->type_->resume ();
00072 }

int ACE_Service_Type::suspend void    const
 

Definition at line 59 of file Service_Object.cpp.

References ACE_TRACE, ACE_Service_Type_Impl::suspend, and type_.

Referenced by ACE_Service_Repository::suspend.

00060 {
00061   ACE_TRACE ("ACE_Service_Type::suspend");
00062   ((ACE_Service_Type *) this)->active_ = 0;
00063   return this->type_->suspend ();
00064 }

ACE_INLINE void ACE_Service_Type::type const ACE_Service_Type_Impl  ,
int    active = 1
 

Definition at line 38 of file Service_Object.i.

References ACE_TRACE, and type_.

00039 {
00040   ACE_TRACE ("ACE_Service_Type::type");
00041   this->type_ = o;
00042   ((ACE_Service_Type *) this)->active_ = enabled;
00043 }

ACE_INLINE const ACE_Service_Type_Impl * ACE_Service_Type::type void    const
 

Definition at line 31 of file Service_Object.i.

References ACE_TRACE, and type_.

Referenced by ace_get_module, ace_yyparse, ACE_Service_Config::initialize, ACE_Dynamic_Service_Base::instance, and ACE_Service_Manager::list_services.

00032 {
00033   ACE_TRACE ("ACE_Service_Type::type");
00034   return this->type_;
00035 }


Member Data Documentation

ACE_Service_Type::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 117 of file Service_Object.h.

int ACE_Service_Type::active_ [private]
 

1 if svc is currently active, otherwise 0.

Definition at line 130 of file Service_Object.h.

Referenced by active.

ACE_DLL ACE_Service_Type::dll_ [private]
 

ACE_DLL representing the shared object file (non-zero if dynamically linked).

Definition at line 127 of file Service_Object.h.

int ACE_Service_Type::fini_already_called_ [private]
 

1 if <fini> on <type_> has already been called, otherwise 0.

Definition at line 133 of file Service_Object.h.

Referenced by fini, and fini_called.

const ACE_TCHAR* ACE_Service_Type::name_ [private]
 

Humanly readible name of svc.

Definition at line 121 of file Service_Object.h.

Referenced by name, and ~ACE_Service_Type.

const ACE_Service_Type_Impl* ACE_Service_Type::type_ [private]
 

Pointer to C++ object that implements the svc.

Definition at line 124 of file Service_Object.h.

Referenced by fini, resume, suspend, and type.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:56:01 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002