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 Member Functions

 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_Typelink (void) const
 Get the link pointer.

void link (ACE_Module_Type *)
 Set the link pointer.

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


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

ACE_Module_Typelink_
 Pointer to the next ACE_Module_Type in an ACE_Stream_Type.


Detailed Description

Define the methods for handling the configuration of ACE_Modules.

Definition at line 117 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 191 of file Service_Types.cpp.

References ACE_TCHAR, and ACE_TRACE.

00194   : ACE_Service_Type_Impl (m, m_name, f)
00195 {
00196   ACE_TRACE ("ACE_Module_Type::ACE_Module_Type");
00197 }

ACE_Module_Type::~ACE_Module_Type void   ) 
 

Definition at line 199 of file Service_Types.cpp.

References ACE_TRACE.

00200 {
00201   ACE_TRACE ("ACE_Module_Type::~ACE_Module_Type");
00202 }


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 184 of file Service_Types.cpp.

References ACE_TRACE.

00185 {
00186 #if defined (ACE_HAS_DUMP)
00187   ACE_TRACE ("ACE_Module_Type::dump");
00188 #endif /* ACE_HAS_DUMP */
00189 }

int ACE_Module_Type::fini void   )  const [virtual]
 

Reimplemented from ACE_Service_Type_Impl.

Definition at line 256 of file Service_Types.cpp.

References ACE_TRACE, ACE_Module<>::close(), ACE_Service_Type_Impl::fini(), ACE_Shared_Object::fini(), MT_Module, MT_Task, ACE_Service_Type_Impl::object(), ACE_Module<>::reader(), and ACE_Module<>::writer().

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

00257 {
00258   ACE_TRACE ("ACE_Module_Type::fini");
00259 
00260   void *obj = this->object ();
00261   MT_Module *mod = (MT_Module *) obj;
00262   MT_Task *reader = mod->reader ();
00263   MT_Task *writer = mod->writer ();
00264 
00265   if (reader != 0)
00266     reader->fini ();
00267 
00268   if (writer != 0)
00269     writer->fini ();
00270 
00271   // Close the module and delete the memory.
00272   mod->close (MT_Module::M_DELETE);
00273   return ACE_Service_Type_Impl::fini ();
00274 }

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

Implements ACE_Service_Type_Impl.

Definition at line 277 of file Service_Types.cpp.

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

00278 {
00279   ACE_TRACE ("ACE_Module_Type::info");
00280   ACE_TCHAR buf[BUFSIZ];
00281 
00282   ACE_OS::sprintf (buf,
00283                    ACE_LIB_TEXT ("%s\t %s"),
00284                    this->name (),
00285                    ACE_LIB_TEXT ("# ACE_Module\n"));
00286 
00287   if (*str == 0 && (*str = ACE_OS::strdup (buf)) == 0)
00288     return -1;
00289   else
00290     ACE_OS::strsncpy (*str, buf, len);
00291   return static_cast<int> (ACE_OS::strlen (buf));
00292 }

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

Implements ACE_Service_Type_Impl.

Definition at line 205 of file Service_Types.cpp.

References ACE_TCHAR, ACE_TRACE, ACE_Shared_Object::init(), MT_Module, MT_Task, ACE_Service_Type_Impl::object(), ACE_Module<>::reader(), and ACE_Module<>::writer().

Referenced by ace_yyparse().

00206 {
00207   ACE_TRACE ("ACE_Module_Type::init");
00208   void *obj = this->object ();
00209   MT_Module *mod = (MT_Module *) obj;
00210   MT_Task *reader = mod->reader ();
00211   MT_Task *writer = mod->writer ();
00212 
00213   if (reader->init (argc, argv) == -1
00214       || writer->init (argc, argv) == -1)
00215     return -1;
00216   else
00217     return 0;
00218 }

void ACE_Module_Type::link ACE_Module_Type  ) 
 

Set the link pointer.

Definition at line 295 of file Service_Types.cpp.

References ACE_TRACE, and link_.

00296 {
00297   ACE_TRACE ("ACE_Module_Type::link");
00298   this->link_ = n;
00299 }

ACE_Module_Type * ACE_Module_Type::link void   )  const
 

Get the link pointer.

Definition at line 302 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().

00303 {
00304   ACE_TRACE ("ACE_Module_Type::link");
00305   return this->link_;
00306 }

int ACE_Module_Type::resume void   )  const [virtual]
 

Implements ACE_Service_Type_Impl.

Definition at line 237 of file Service_Types.cpp.

References ACE_TRACE, MT_Module, MT_Task, 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().

00238 {
00239   ACE_TRACE ("ACE_Module_Type::resume");
00240   void *obj = this->object ();
00241   MT_Module *mod = (MT_Module *) obj;
00242   MT_Task *reader = mod->reader ();
00243   MT_Task *writer = mod->writer ();
00244 
00245   if (reader->resume () == -1
00246       || writer->resume () == -1)
00247     return -1;
00248   else
00249     return 0;
00250 }

int ACE_Module_Type::suspend void   )  const [virtual]
 

Implements ACE_Service_Type_Impl.

Definition at line 221 of file Service_Types.cpp.

References ACE_TRACE, MT_Module, MT_Task, 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().

00222 {
00223   ACE_TRACE ("ACE_Module_Type::suspend");
00224   void *obj = this->object ();
00225   MT_Module *mod = (MT_Module *) obj;
00226   MT_Task *reader = mod->reader ();
00227   MT_Task *writer = mod->writer ();
00228 
00229   if (reader->suspend () == -1
00230       || writer->suspend () == -1)
00231     return -1;
00232   else
00233     return 0;
00234 }


Member Data Documentation

ACE_Module_Type::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Reimplemented from ACE_Service_Type_Impl.

Definition at line 144 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 148 of file Service_Types.h.

Referenced by link().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:25:07 2006 for ACE by doxygen 1.3.6