TAO_Notify::Standard_Event_Persistence Class Reference

The standard implementation of the Event_Persistence_Strategy interface. More...

#include <Standard_Event_Persistence.h>

Inheritance diagram for TAO_Notify::Standard_Event_Persistence:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify::Standard_Event_Persistence:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Standard_Event_Persistence ()
 Constructor.

virtual ~Standard_Event_Persistence ()
 Destructor.

virtual int init (int argc, ACE_TCHAR *argv[])
virtual int fini ()
virtual Event_Persistence_Factoryget_factory ()

Private Member Functions

virtual void reset ()

Private Attributes

ACE_TString filename_
ACE_UINT32 block_size_
Standard_Event_Persistence_Factoryfactory_

Detailed Description

The standard implementation of the Event_Persistence_Strategy interface.

Definition at line 101 of file Standard_Event_Persistence.h.


Constructor & Destructor Documentation

TAO_Notify::Standard_Event_Persistence::Standard_Event_Persistence  ) 
 

Constructor.

Definition at line 14 of file Standard_Event_Persistence.cpp.

References ACE_TEXT().

00015   : filename_ (ACE_TEXT ("__PERSISTENT_EVENT__.DB"))
00016   , block_size_ (512)
00017   , factory_ (0)
00018 {
00019 }

TAO_Notify::Standard_Event_Persistence::~Standard_Event_Persistence  )  [virtual]
 

Destructor.

Definition at line 21 of file Standard_Event_Persistence.cpp.

00022 {
00023 }


Member Function Documentation

int TAO_Notify::Standard_Event_Persistence::fini  )  [virtual]
 

Reimplemented from ACE_Shared_Object.

Definition at line 107 of file Standard_Event_Persistence.cpp.

00108 {
00109   delete this->factory_;
00110   this->factory_ = 0;
00111   return 0;
00112 }

Event_Persistence_Factory * TAO_Notify::Standard_Event_Persistence::get_factory  )  [virtual]
 

Implements TAO_Notify::Event_Persistence_Strategy.

Definition at line 27 of file Standard_Event_Persistence.cpp.

References ACE_NEW_NORETURN, and TAO_Notify::Standard_Event_Persistence_Factory::open().

00028 {
00029   //@@todo guard? ; doublecheck?
00030   if (this->factory_ == 0)
00031   {
00032     ACE_NEW_NORETURN (
00033       this->factory_,
00034       Standard_Event_Persistence_Factory ()
00035       );
00036     if (this->factory_ != 0)
00037     {
00038       if (!this->factory_->open (this->filename_.c_str ()))
00039       {
00040         this->factory_ = 0;
00041       }
00042     }
00043   }
00044   return this->factory_;
00045 }

int TAO_Notify::Standard_Event_Persistence::init int  argc,
ACE_TCHAR argv[]
[virtual]
 

Reimplemented from ACE_Shared_Object.

Definition at line 56 of file Standard_Event_Persistence.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TCHAR, ACE_TEXT(), ACE_OS::atoi(), LM_DEBUG, LM_ERROR, ACE_OS::strcasecmp(), and TAO_debug_level.

00057 {
00058   int result = 0;
00059   bool verbose = false;
00060   for (int narg = 0; narg < argc; ++narg)
00061   {
00062     ACE_TCHAR * av = argv[narg];
00063     if (ACE_OS::strcasecmp (av, ACE_TEXT ("-v")) == 0)
00064     {
00065       verbose = true;
00066       ACE_DEBUG ((LM_DEBUG,
00067         ACE_TEXT ("(%P|%t) Standard_Event_Persistence: -verbose\n")
00068         ));
00069     }
00070     else if (ACE_OS::strcasecmp (av, ACE_TEXT ("-file_path")) == 0 && narg + 1 < argc)
00071     {
00072       this->filename_ = argv[narg + 1];
00073       if (TAO_debug_level > 0 || verbose)
00074       {
00075         ACE_DEBUG ((LM_DEBUG,
00076           ACE_TEXT ("(%P|%t) Standard_Event_Persistence: Setting -file_path: %s\n"),
00077           this->filename_.c_str ()
00078         ));
00079       }
00080       narg += 1;
00081     }
00082     else if (ACE_OS::strcasecmp (av, ACE_TEXT ("-block_size")) == 0 && narg + 1 < argc)
00083     {
00084       this->block_size_ = ACE_OS::atoi(argv[narg + 1]);
00085       if (TAO_debug_level > 0 || verbose)
00086       {
00087         ACE_DEBUG ((LM_DEBUG,
00088           ACE_TEXT ("(%P|%t) Standard_Event_Persistence: Setting -block_size: %d\n"),
00089           this->block_size_
00090         ));
00091       }
00092       narg += 1;
00093     }
00094     else
00095     {
00096       ACE_ERROR ((LM_ERROR,
00097         ACE_TEXT ("(%P|%t) Unknown parameter to Standard Event Persistence: %s\n"),
00098         argv[narg]
00099         ));
00100       result = -1;
00101     }
00102   }
00103   return result;
00104 }

void TAO_Notify::Standard_Event_Persistence::reset  )  [private, virtual]
 

Implements TAO_Notify::Event_Persistence_Strategy.

Definition at line 49 of file Standard_Event_Persistence.cpp.

00050 {
00051   delete this->factory_;
00052   this->factory_ = 0;
00053 }


Member Data Documentation

ACE_UINT32 TAO_Notify::Standard_Event_Persistence::block_size_ [private]
 

Definition at line 124 of file Standard_Event_Persistence.h.

Standard_Event_Persistence_Factory* TAO_Notify::Standard_Event_Persistence::factory_ [private]
 

Definition at line 125 of file Standard_Event_Persistence.h.

ACE_TString TAO_Notify::Standard_Event_Persistence::filename_ [private]
 

Definition at line 123 of file Standard_Event_Persistence.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 13:34:34 2006 for TAO_CosNotification by doxygen 1.3.6