#include <ECG_CDR_Message_Receiver.h>
Collaboration diagram for TAO_ECG_CDR_Message_Receiver::Requests:
Public Member Functions | |
Requests (void) | |
~Requests (void) | |
int | init (size_t size, size_t min_purge_count) |
Allocates and initializes . | |
TAO_ECG_UDP_Request_Entry ** | get_request (CORBA::ULong request_id) |
Private Member Functions | |
void | purge_requests (CORBA::ULong purge_first, CORBA::ULong purge_last) |
Requests & | operator= (const Requests &rhs) |
Requests (const Requests &rhs) | |
Private Attributes | |
TAO_ECG_UDP_Request_Entry ** | fragmented_requests_ |
size_t | size_ |
Size of array. | |
size_t | min_purge_count_ |
Minimum range shifting amount. | |
CORBA::ULong | id_range_low_ |
CORBA::ULong | id_range_high_ |
Definition at line 260 of file ECG_CDR_Message_Receiver.h.
|
Definition at line 8 of file ECG_CDR_Message_Receiver.i.
00009 : fragmented_requests_ (0) 00010 , size_ (0) 00011 , id_range_low_ (0) 00012 , id_range_high_ (0) 00013 , min_purge_count_ (0) 00014 { 00015 } |
|
Definition at line 159 of file ECG_CDR_Message_Receiver.cpp. References fragmented_requests_, id_range_high_, id_range_low_, and TAO_ECG_CDR_Message_Receiver::Request_Completed_.
00160 { 00161 for (size_t i = 0; i < this->size_; ++i) 00162 { 00163 TAO_ECG_UDP_Request_Entry* request = 00164 this->fragmented_requests_[i]; 00165 00166 if (request != &TAO_ECG_CDR_Message_Receiver::Request_Completed_) 00167 delete request; 00168 } 00169 00170 delete [] this->fragmented_requests_; 00171 00172 this->fragmented_requests_ = 0; 00173 this->size_ = 0; 00174 this->id_range_low_ = 0; 00175 this->id_range_high_ = 0; 00176 } |
|
|
|
If < return 0. If > , shift the range so it includes , purging incomplete requests as needed. Definition at line 179 of file ECG_CDR_Message_Receiver.cpp. References fragmented_requests_, id_range_high_, id_range_low_, min_purge_count_, and purge_requests().
00180 { 00181 if (request_id < this->id_range_low_) 00182 // <request_id> is below the current range. 00183 { 00184 return 0; 00185 } 00186 00187 if (request_id > this->id_range_high_) 00188 // <request_id> is above the current range - need to shift the range 00189 // to include it. 00190 { 00191 CORBA::ULong new_slots_needed = request_id - this->id_range_high_; 00192 00193 if (new_slots_needed < this->min_purge_count_) 00194 new_slots_needed = this->min_purge_count_; 00195 00196 if (new_slots_needed > this->size_) 00197 // Shifting the range by more than the size of array. 00198 { 00199 this->purge_requests (this->id_range_low_, this->id_range_high_); 00200 this->id_range_high_ = request_id; 00201 this->id_range_low_ = request_id - this->size_ + 1; 00202 } 00203 else 00204 { 00205 this->purge_requests (this->id_range_low_, 00206 this->id_range_low_ + new_slots_needed - 1); 00207 this->id_range_high_ += new_slots_needed; 00208 this->id_range_low_ += new_slots_needed; 00209 } 00210 } 00211 00212 // Return array location for <request_id>. 00213 int index = request_id % this->size_; 00214 return this->fragmented_requests_ + index; 00215 } |
|
Allocates and initializes .
Definition at line 135 of file ECG_CDR_Message_Receiver.cpp. References ACE_NEW_RETURN, fragmented_requests_, id_range_high_, id_range_low_, and min_purge_count_. Referenced by TAO_ECG_CDR_Message_Receiver::get_source_entry().
00137 { 00138 // Already initialized. 00139 if (this->fragmented_requests_) 00140 return -1; 00141 00142 ACE_NEW_RETURN (this->fragmented_requests_, 00143 TAO_ECG_UDP_Request_Entry*[size], 00144 -1); 00145 00146 this->size_ = size; 00147 this->id_range_low_ = 0; 00148 this->id_range_high_ = size - 1; 00149 this->min_purge_count_ = min_purge_count; 00150 00151 for (size_t i = 0; i < size; ++i) 00152 { 00153 this->fragmented_requests_[i] = 0; 00154 } 00155 00156 return 0; 00157 } |
|
|
|
Delete any outstanding requests with ids in the range [, ] from and and reset their slots. Definition at line 219 of file ECG_CDR_Message_Receiver.cpp. References fragmented_requests_, and TAO_ECG_CDR_Message_Receiver::Request_Completed_. Referenced by get_request().
00222 { 00223 for (CORBA::ULong i = purge_first; i <= purge_last; ++i) 00224 { 00225 size_t index = i % this->size_; 00226 if (this->fragmented_requests_[index] 00227 != &TAO_ECG_CDR_Message_Receiver::Request_Completed_) 00228 { 00229 delete this->fragmented_requests_[index]; 00230 } 00231 this->fragmented_requests_[index] = 0; 00232 } 00233 } |
|
Array, used in a circular fashion, that stores partially received requests (and info on which requests have been fully received and processed) for a range of request ids. Definition at line 294 of file ECG_CDR_Message_Receiver.h. Referenced by get_request(), init(), purge_requests(), and ~Requests(). |
|
The range of request ids, currently represented in . Definition at line 303 of file ECG_CDR_Message_Receiver.h. Referenced by get_request(), init(), and ~Requests(). |
|
The range of request ids, currently represented in . Definition at line 302 of file ECG_CDR_Message_Receiver.h. Referenced by get_request(), init(), and ~Requests(). |
|
Minimum range shifting amount.
Definition at line 307 of file ECG_CDR_Message_Receiver.h. Referenced by get_request(), and init(). |
|
Size of array.
Definition at line 297 of file ECG_CDR_Message_Receiver.h. |