| 277 | } |
| 278 | |
| 279 | int |
| 280 | PersistenceUpdater::init(int argc, ACE_TCHAR *argv[]) |
| 281 | { |
| 282 | // discover the UpdateManager |
| 283 | um_ = ACE_Dynamic_Service<Update::Manager>::instance("UpdateManagerSvc"); |
| 284 | |
| 285 | if (um_ == 0) { |
| 286 | ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: PersistenceUpdater::init ") |
| 287 | ACE_TEXT("No UpdateManager discovered.\n"))); |
| 288 | return -1; |
| 289 | } |
| 290 | |
| 291 | this->parse(argc, argv); |
| 292 | |
| 293 | #if defined ACE_HAS_MAC_OSX && defined __x86_64__ && __x86_64__ |
| 294 | ACE_MMAP_Memory_Pool::OPTIONS options((void*)0x200000000); |
| 295 | #else |
| 296 | ACE_MMAP_Memory_Pool::OPTIONS options(ACE_DEFAULT_BASE_ADDR); |
| 297 | #endif |
| 298 | |
| 299 | // Create the allocator with the appropriate options. The name used |
| 300 | // for the lock is the same as one used for the file. |
| 301 | ALLOCATOR* allocator; |
| 302 | ACE_NEW_RETURN(allocator, |
| 303 | ALLOCATOR(persistence_file_.c_str(), |
| 304 | persistence_file_.c_str(), |
| 305 | &options), |
| 306 | -1); |
| 307 | allocator_.reset(allocator); |
| 308 | |
| 309 | bool exists = false; |
| 310 | |
| 311 | char* topic_index = (char*)createIndex("TopicIndex", *allocator_ |
| 312 | , sizeof(TopicIndex), exists); |
| 313 | if (!topic_index) { |
| 314 | return -1; |
| 315 | } |
| 316 | |
| 317 | char* participant_index = (char*)createIndex("ParticipantIndex", *allocator_ |
| 318 | , sizeof(ParticipantIndex), exists); |
| 319 | if (!participant_index) { |
| 320 | return -1; |
| 321 | } |
| 322 | |
| 323 | char* actor_index = (char*)createIndex("ActorIndex", *allocator_ |
| 324 | , sizeof(ActorIndex), exists); |
| 325 | if (!actor_index) { |
| 326 | return -1; |
| 327 | } |
| 328 | |
| 329 | void* last_part_id = createIndex( |
| 330 | "LastParticipantId", *allocator_, sizeof(PartIdType), exists); |
| 331 | if (!last_part_id) { |
| 332 | return -1; |
| 333 | } |
| 334 | last_part_id_ = reinterpret_cast<PartIdType*>(last_part_id); |
| 335 | |
| 336 | if (exists) { |
nothing calls this directly
no test coverage detected