OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
3 * All rights reserved. | 3 * All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 O3D_DEFN_CLASS(Pack, NamedObject) | 54 O3D_DEFN_CLASS(Pack, NamedObject) |
55 | 55 |
56 Pack::Pack(ServiceLocator* service_locator) | 56 Pack::Pack(ServiceLocator* service_locator) |
57 : NamedObject(service_locator), | 57 : NamedObject(service_locator), |
58 class_manager_(service_locator->GetService<IClassManager>()), | 58 class_manager_(service_locator->GetService<IClassManager>()), |
59 object_manager_(service_locator->GetService<ObjectManager>()), | 59 object_manager_(service_locator->GetService<ObjectManager>()), |
60 renderer_(service_locator->GetService<Renderer>()) { | 60 renderer_(service_locator->GetService<Renderer>()) { |
61 } | 61 } |
62 | 62 |
63 Pack::~Pack() { | 63 Pack::~Pack() { |
| 64 DLOG(INFO) << owned_objects_.size() |
| 65 << " objects still in Pack at time of deletion"; |
64 } | 66 } |
65 | 67 |
66 bool Pack::Destroy() { | 68 bool Pack::Destroy() { |
67 return object_manager_->DestroyPack(this); | 69 return object_manager_->DestroyPack(this); |
68 } | 70 } |
69 | 71 |
70 bool Pack::RemoveObject(ObjectBase* object) { | 72 bool Pack::RemoveObject(ObjectBase* object) { |
71 return UnregisterObject(object); | 73 return UnregisterObject(object); |
72 } | 74 } |
73 | 75 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 487 |
486 bool Pack::UnregisterObject(ObjectBase *object) { | 488 bool Pack::UnregisterObject(ObjectBase *object) { |
487 ObjectSet::iterator find(owned_objects_.find(ObjectBase::Ref(object))); | 489 ObjectSet::iterator find(owned_objects_.find(ObjectBase::Ref(object))); |
488 if (find == owned_objects_.end()) | 490 if (find == owned_objects_.end()) |
489 return false; | 491 return false; |
490 | 492 |
491 owned_objects_.erase(find); | 493 owned_objects_.erase(find); |
492 return true; | 494 return true; |
493 } | 495 } |
494 } // namespace o3d | 496 } // namespace o3d |
OLD | NEW |