TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header Class Reference

private: Storage for header information of all persistent block. More...

Inheritance diagram for TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header:

Inheritance graph
[legend]
List of all members.

Public Types

 BT_Routing_Slip
 BT_Event
 BT_Overflow
enum  Header_Type { BT_Routing_Slip, BT_Event, BT_Overflow }

Public Member Functions

 Block_Header (Header_Type type)
virtual ~Block_Header (void)
virtual size_t extract_header (Persistent_Storage_Block &psb, size_t offset=0)
virtual size_t put_header (Persistent_Storage_Block &psb, size_t offset=0)

Public Attributes

Block_Serial_Number serial_number
 Our serial number.
Block_Number next_overflow
 Address of the overflow record (if any).
Block_Type header_type
 How much extra header data is in this block (not including this header).
Block_Size data_size
 How much actual data is in this block? (not including headers).

Detailed Description

private: Storage for header information of all persistent block.

Definition at line 126 of file Routing_Slip_Persistence_Manager.h.


Member Enumeration Documentation

enum TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::Header_Type

Enumerator:
BT_Routing_Slip 
BT_Event 
BT_Overflow 

Definition at line 129 of file Routing_Slip_Persistence_Manager.h.

00129                      {
00130       BT_Routing_Slip,
00131       BT_Event,
00132       BT_Overflow
00133       };


Constructor & Destructor Documentation

TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::Block_Header ( Header_Type  type  ) 

Definition at line 274 of file Routing_Slip_Persistence_Manager.cpp.

00275   : serial_number (0)
00276   , next_overflow(0)
00277   , header_type (static_cast<Block_Type> (type))
00278   , data_size(0)
00279 {
00280 }

TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::~Block_Header ( void   )  [virtual]

Definition at line 281 of file Routing_Slip_Persistence_Manager.cpp.

00282 {
00283 }


Member Function Documentation

size_t TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::extract_header ( Persistent_Storage_Block psb,
size_t  offset = 0 
) [virtual]

Reimplemented in TAO_Notify::Routing_Slip_Persistence_Manager::Routing_Slip_Header.

Definition at line 286 of file Routing_Slip_Persistence_Manager.cpp.

References TAO_Notify::Persistent_Storage_Block::data(), data_size, header_type, next_overflow, and serial_number.

Referenced by TAO_Notify::Routing_Slip_Persistence_Manager::Routing_Slip_Header::extract_header(), and TAO_Notify::Routing_Slip_Persistence_Manager::reload_chain().

00288 {
00289   size_t pos = offset;
00290   unsigned char* data = psb.data();
00291 
00292   serial_number = data[pos++];
00293   serial_number = (serial_number << 8) + data[pos++];
00294   serial_number = (serial_number << 8) + data[pos++];
00295   serial_number = (serial_number << 8) + data[pos++];
00296   serial_number = (serial_number << 8) + data[pos++];
00297   serial_number = (serial_number << 8) + data[pos++];
00298   serial_number = (serial_number << 8) + data[pos++];
00299   serial_number = (serial_number << 8) + data[pos++];
00300 
00301   next_overflow = data[pos++];
00302   next_overflow = (next_overflow << 8) + data[pos++];
00303   next_overflow = (next_overflow << 8) + data[pos++];
00304   next_overflow = (next_overflow << 8) + data[pos++];
00305 
00306   header_type = data[pos++];
00307   header_type = (data_size << 8) + data[pos++];
00308 
00309   data_size = data[pos++];
00310   data_size = (data_size << 8) + data[pos++];
00311   return pos;
00312 }

size_t TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::put_header ( Persistent_Storage_Block psb,
size_t  offset = 0 
) [virtual]

Reimplemented in TAO_Notify::Routing_Slip_Persistence_Manager::Routing_Slip_Header.

Definition at line 315 of file Routing_Slip_Persistence_Manager.cpp.

References TAO_Notify::Persistent_Storage_Block::data(), data_size, header_type, next_overflow, and serial_number.

Referenced by TAO_Notify::Routing_Slip_Persistence_Manager::build_chain(), and TAO_Notify::Routing_Slip_Persistence_Manager::Routing_Slip_Header::put_header().

00317 {
00318   // Assume that our psb can hold our small amount of data...
00319   size_t pos = offset;
00320   unsigned char* data = psb.data();
00321   // Store serial_number
00322   data[pos++] = static_cast<unsigned char> ((serial_number >> 56) & 0xff);
00323   data[pos++] = static_cast<unsigned char> ((serial_number >> 48) & 0xff);
00324   data[pos++] = static_cast<unsigned char> ((serial_number >> 40) & 0xff);
00325   data[pos++] = static_cast<unsigned char> ((serial_number >> 32) & 0xff);
00326   data[pos++] = static_cast<unsigned char> ((serial_number >> 24) & 0xff);
00327   data[pos++] = static_cast<unsigned char> ((serial_number >> 16) & 0xff);
00328   data[pos++] = static_cast<unsigned char> ((serial_number >> 8) & 0xff);
00329   data[pos++] = static_cast<unsigned char> ((serial_number >> 0) & 0xff);
00330   // Store next_overflow
00331   data[pos++] = static_cast<unsigned char> (next_overflow >> 24);
00332   data[pos++] = static_cast<unsigned char> ((next_overflow >> 16) & 0xff);
00333   data[pos++] = static_cast<unsigned char> ((next_overflow >> 8) & 0xff);
00334   data[pos++] = static_cast<unsigned char> (next_overflow & 0xff);
00335   // Store header_type
00336   data[pos++] = static_cast<unsigned char> ((header_type >> 8) & 0xff);
00337   data[pos++] = static_cast<unsigned char> (header_type & 0xff);
00338   // Store data_size
00339   data[pos++] = static_cast<unsigned char> ((data_size >> 8) & 0xff);
00340   data[pos++] = static_cast<unsigned char> (data_size & 0xff);
00341 
00342   return pos;
00343 }


Member Data Documentation

Block_Size TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::data_size

How much actual data is in this block? (not including headers).

Definition at line 150 of file Routing_Slip_Persistence_Manager.h.

Referenced by TAO_Notify::Routing_Slip_Persistence_Manager::build_chain(), extract_header(), put_header(), and TAO_Notify::Routing_Slip_Persistence_Manager::reload_chain().

Block_Type TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::header_type

How much extra header data is in this block (not including this header).

Definition at line 148 of file Routing_Slip_Persistence_Manager.h.

Referenced by extract_header(), and put_header().

Block_Number TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::next_overflow

Address of the overflow record (if any).

Definition at line 146 of file Routing_Slip_Persistence_Manager.h.

Referenced by TAO_Notify::Routing_Slip_Persistence_Manager::build_chain(), extract_header(), put_header(), and TAO_Notify::Routing_Slip_Persistence_Manager::reload_chain().

Block_Serial_Number TAO_Notify::Routing_Slip_Persistence_Manager::Block_Header::serial_number

Our serial number.

Definition at line 144 of file Routing_Slip_Persistence_Manager.h.

Referenced by extract_header(), put_header(), TAO_Notify::Routing_Slip_Persistence_Manager::reload_chain(), TAO_Notify::Routing_Slip_Persistence_Manager::store_i(), and TAO_Notify::Routing_Slip_Persistence_Manager::store_root().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:46:43 2010 for TAO_CosNotification by  doxygen 1.4.7