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

ACE_Module_Type Class Reference

Define the methods for handling the configuration of <ACE_Modules>. More...

#include <Service_Types.h>

Inheritance diagram for ACE_Module_Type:

Inheritance graph
[legend]
Collaboration diagram for ACE_Module_Type:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Module_Type (void *m, const ACE_TCHAR *identifier, u_int flags=0)
 ~ACE_Module_Type (void)
virtual int suspend (void) const
virtual int resume (void) const
virtual int init (int argc, ACE_TCHAR *argv[]) const
virtual int fini (void) const
virtual int info (ACE_TCHAR **str, size_t len) const
ACE_Module_Type * link (void) const
void link (ACE_Module_Type *)
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

ACE_Module_Type * link_
 Pointer to the next <ACE_Module_Type> in an <ACE_Stream_Type>. More...


Detailed Description

Define the methods for handling the configuration of <ACE_Modules>.

Definition at line 118 of file Service_Types.h.


Constructor & Destructor Documentation

ACE_Module_Type::ACE_Module_Type void *    m,
const ACE_TCHAR   identifier,
u_int    flags = 0
 

Definition at line 109 of file Service_Types.cpp.

References ACE_TCHAR, and ACE_TRACE.

00112   : ACE_Service_Type_Impl (m, m_name, f)
00113 {
00114   ACE_TRACE ("ACE_Module_Type::ACE_Module_Type");
00115 }

ACE_INLINE ACE_Module_Type::~ACE_Module_Type void   
 

Definition at line 55 of file Service_Types.i.

References ACE_TRACE.

00056 {
00057   ACE_TRACE ("ACE_Module_Type::~ACE_Module_Type");
00058 }


Member Function Documentation

void ACE_Module_Type::dump void    const
 

Dump the state of an object.

Reimplemented from ACE_Service_Type_Impl.

Definition at line 104 of file Service_Types.cpp.

References ACE_TRACE.

00105 {
00106   ACE_TRACE ("ACE_Module_Type::dump");
00107 }

int ACE_Module_Type::fini void    const [virtual]
 

Reimplemented from ACE_Service_Type_Impl.

Definition at line 169 of file Service_Types.cpp.

References ACE_TRACE, ACE_Module::close, ACE_Service_Type_Impl::fini, ACE_Shared_Object::fini, ACE_Service_Type_Impl::object, ACE_Module::reader, and ACE_Module::writer.

Referenced by ACE_Stream_Type::fini, and ACE_Stream_Type::remove.

00170 {
00171   ACE_TRACE ("ACE_Module_Type::fini");
00172 
00173   void *obj = this->object ();
00174   MT_Module *mod = (MT_Module *) obj;
00175   MT_Task *reader = mod->reader ();
00176   MT_Task *writer = mod->writer ();
00177 
00178   if (reader != 0)
00179     reader->fini ();
00180 
00181   if (writer != 0)
00182     writer->fini ();
00183 
00184   // Close the module and delete the memory.
00185   mod->close (MT_Module::M_DELETE);
00186   return ACE_Service_Type_Impl::fini ();
00187 }

int ACE_Module_Type::info ACE_TCHAR **    str,
size_t    len
const [virtual]
 

Implements ACE_Service_Type_Impl.

Definition at line 190 of file Service_Types.cpp.

References ACE_LIB_TEXT, ACE_TCHAR, ACE_TRACE, ACE_OS::sprintf, ACE_OS_String::strdup, ACE_OS_String::strlen, and ACE_OS_String::strsncpy.

00191 {
00192   ACE_TRACE ("ACE_Module_Type::info");
00193   ACE_TCHAR buf[BUFSIZ];
00194 
00195   ACE_OS::sprintf (buf,
00196                    ACE_LIB_TEXT ("%s\t %s"),
00197                    this->name (),
00198                    ACE_LIB_TEXT ("# ACE_Module\n"));
00199 
00200   if (*str == 0 && (*str = ACE_OS::strdup (buf)) == 0)
00201     return -1;
00202   else
00203     ACE_OS::strsncpy (*str, buf, len);
00204   return ACE_static_cast (int, ACE_OS_String::strlen (buf));
00205 }

int ACE_Module_Type::init int    argc,
ACE_TCHAR   argv[]
const [virtual]
 

Implements ACE_Service_Type_Impl.

Definition at line 118 of file Service_Types.cpp.

References ACE_TCHAR, ACE_TRACE, ACE_Shared_Object::init, ACE_Service_Type_Impl::object, ACE_Module::reader, and ACE_Module::writer.

Referenced by ace_yyparse.

00119 {
00120   ACE_TRACE ("ACE_Module_Type::init");
00121   void *obj = this->object ();
00122   MT_Module *mod = (MT_Module *) obj;
00123   MT_Task *reader = mod->reader ();
00124   MT_Task *writer = mod->writer ();
00125 
00126   if (reader->init (argc, argv) == -1
00127       || writer->init (argc, argv) == -1)
00128     return -1;
00129   else
00130     return 0;
00131 }

void ACE_Module_Type::link ACE_Module_Type *   
 

Definition at line 208 of file Service_Types.cpp.

References ACE_TRACE, and link_.

00209 {
00210   ACE_TRACE ("ACE_Module_Type::link");
00211   this->link_ = n;
00212 }

ACE_Module_Type * ACE_Module_Type::link void    const
 

Definition at line 215 of file Service_Types.cpp.

References ACE_TRACE, and link_.

Referenced by ACE_Stream_Type::find, ACE_Stream_Type::fini, ACE_Stream_Type::push, ACE_Stream_Type::remove, ACE_Stream_Type::resume, and ACE_Stream_Type::suspend.

00216 {
00217   ACE_TRACE ("ACE_Module_Type::link");
00218   return this->link_;
00219 }

int ACE_Module_Type::resume void    const [virtual]
 

Implements ACE_Service_Type_Impl.

Definition at line 150 of file Service_Types.cpp.

References ACE_TRACE, ACE_Service_Type_Impl::object, ACE_Module::reader, ACE_Task_Base::resume, and ACE_Module::writer.

Referenced by ace_yyparse, and ACE_Stream_Type::resume.

00151 {
00152   ACE_TRACE ("ACE_Module_Type::resume");
00153   void *obj = this->object ();
00154   MT_Module *mod = (MT_Module *) obj;
00155   MT_Task *reader = mod->reader ();
00156   MT_Task *writer = mod->writer ();
00157 
00158   if (reader->resume () == -1
00159       || writer->resume () == -1)
00160     return -1;
00161   else
00162     return 0;
00163 }

int ACE_Module_Type::suspend void    const [virtual]
 

Implements ACE_Service_Type_Impl.

Definition at line 134 of file Service_Types.cpp.

References ACE_TRACE, ACE_Service_Type_Impl::object, ACE_Module::reader, ACE_Task_Base::suspend, and ACE_Module::writer.

Referenced by ace_yyparse, and ACE_Stream_Type::suspend.

00135 {
00136   ACE_TRACE ("ACE_Module_Type::suspend");
00137   void *obj = this->object ();
00138   MT_Module *mod = (MT_Module *) obj;
00139   MT_Task *reader = mod->reader ();
00140   MT_Task *writer = mod->writer ();
00141 
00142   if (reader->suspend () == -1
00143       || writer->suspend () == -1)
00144     return -1;
00145   else
00146     return 0;
00147 }


Member Data Documentation

ACE_Module_Type::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Service_Type_Impl.

Definition at line 145 of file Service_Types.h.

ACE_Module_Type* ACE_Module_Type::link_ [private]
 

Pointer to the next <ACE_Module_Type> in an <ACE_Stream_Type>.

Definition at line 149 of file Service_Types.h.

Referenced by link.


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