Standard (i.e. default) implementation of Event_Persistence_Factory interface. More...
#include <Standard_Event_Persistence.h>
Standard (i.e. default) implementation of Event_Persistence_Factory interface.
Definition at line 39 of file Standard_Event_Persistence.h.
TAO_Notify::Standard_Event_Persistence_Factory::Standard_Event_Persistence_Factory | ( | ) |
Constructor.
Definition at line 115 of file Standard_Event_Persistence.cpp.
: allocator_() , root_(this) , psb_(0) , serial_number_(ROUTING_SLIP_ROOT_SERIAL_NUMBER + 1) , is_reloading_ (false) { }
TAO_Notify::Standard_Event_Persistence_Factory::~Standard_Event_Persistence_Factory | ( | ) | [virtual] |
Destructor.
Definition at line 143 of file Standard_Event_Persistence.cpp.
Persistent_File_Allocator * TAO_Notify::Standard_Event_Persistence_Factory::allocator | ( | void | ) |
Accessor for file allocator. Intended for use only by the Routing Slip Persistence Manager
Definition at line 218 of file Standard_Event_Persistence.cpp.
{ return &this->allocator_; }
Routing_Slip_Persistence_Manager * TAO_Notify::Standard_Event_Persistence_Factory::create_routing_slip_persistence_manager | ( | Persistent_Callback * | callback | ) | [virtual] |
Create a Persistence Manager.
Implements TAO_Notify::Event_Persistence_Factory.
Definition at line 158 of file Standard_Event_Persistence.cpp.
{ Routing_Slip_Persistence_Manager* rspm = 0; ACE_NEW_RETURN(rspm, Routing_Slip_Persistence_Manager(this), rspm); rspm->set_callback(callback); return rspm; }
void TAO_Notify::Standard_Event_Persistence_Factory::done_reloading | ( | Persistent_Storage_Block * | next_psb, | |
ACE_UINT64 | current_serial_number | |||
) |
reloading process complete. Where should the chain continue?
Definition at line 179 of file Standard_Event_Persistence.cpp.
{ ACE_ASSERT (this->psb_ == 0); this->psb_ = next_psb; this->serial_number_ = current_serial_number; this->is_reloading_ = false; }
Routing_Slip_Persistence_Manager * TAO_Notify::Standard_Event_Persistence_Factory::first_reload_manager | ( | ) | [virtual] |
Begin the reload process by returning the first Routing_Slip_Persistence_Manager to continue call Routing_Slip_Persistence_Manager::load_next ()
Implements TAO_Notify::Event_Persistence_Factory.
Definition at line 168 of file Standard_Event_Persistence.cpp.
{ Routing_Slip_Persistence_Manager * result = 0; if (this->is_reloading_) { result = this->root_.load_next(); } return result; }
void TAO_Notify::Standard_Event_Persistence_Factory::get_preallocated_pointer | ( | ACE_UINT64 & | next_serial_number, | |
ACE_UINT32 & | next_block_number | |||
) |
Definition at line 206 of file Standard_Event_Persistence.cpp.
{ ++this->serial_number_; this->psb_ = this->allocator_.allocate(); next_serial_number = this->serial_number_; next_block_number = ACE_Utils::truncate_cast<ACE_UINT32> (this->psb_->block_number()); }
bool TAO_Notify::Standard_Event_Persistence_Factory::open | ( | const ACE_TCHAR * | filename, | |
ACE_UINT32 | block_size = 512 | |||
) |
Open persistence file and initialize. /param filename the fully qualified path/name of the file to contain persistent information. /param block_size the size of a physical block on the device containing the file.
Definition at line 125 of file Standard_Event_Persistence.cpp.
{ bool result = false; if (allocator_.open (filename, block_size)) { this->is_reloading_ = this->root_.load(ROUTING_SLIP_ROOT_BLOCK_NUMBER, ROUTING_SLIP_ROOT_SERIAL_NUMBER); if (! this->is_reloading_) { ACE_ASSERT (this->psb_ == 0); // this->psb_ = this->allocator_.allocate(); this->root_.store_root(); } result = true; } return result; }
void TAO_Notify::Standard_Event_Persistence_Factory::preallocate_next_record | ( | ACE_UINT64 & | current_serial_number, | |
Persistent_Storage_Block *& | current_psb, | |||
ACE_UINT64 & | next_serial_number, | |||
ACE_UINT32 & | next_block_number | |||
) |
return current serial # and a psb containing current record# allocate new serial # and record number, and return those, too.
Definition at line 190 of file Standard_Event_Persistence.cpp.
{ // return current serial number and // a psb containing current record number current_serial_number = this->serial_number_; this->psb_->set_allocator_owns(false); // give up ownership this->psb_->set_sync(); current_psb = this->psb_; this->get_preallocated_pointer (next_serial_number, next_block_number); }
Routing_Slip_Persistence_Manager & TAO_Notify::Standard_Event_Persistence_Factory::root | ( | void | ) |
Access root record. Intended for use only by the Routing Slip Persistence Manager
Definition at line 224 of file Standard_Event_Persistence.cpp.
{ return this->root_; }
Definition at line 92 of file Standard_Event_Persistence.h.
Definition at line 96 of file Standard_Event_Persistence.h.
TAO_SYNCH_MUTEX TAO_Notify::Standard_Event_Persistence_Factory::lock |
Definition at line 89 of file Standard_Event_Persistence.h.
Definition at line 94 of file Standard_Event_Persistence.h.
Definition at line 93 of file Standard_Event_Persistence.h.
Definition at line 95 of file Standard_Event_Persistence.h.