/core/externals/update-engine/externals/google-toolbox-for-mac/Foundation/GTMLightweightProxy.h

http://macfuse.googlecode.com/ · C++ Header · 46 lines · 9 code · 6 blank · 31 comment · 0 complexity · f5c0b544f17c1b368eb7fb955ba23148 MD5 · raw file

  1. //
  2. // GTMLightweightProxy.h
  3. //
  4. // Copyright 2006-2008 Google Inc.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  7. // use this file except in compliance with the License. You may obtain a copy
  8. // of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. // License for the specific language governing permissions and limitations under
  16. // the License.
  17. //
  18. #import <Foundation/Foundation.h>
  19. //
  20. // GTMLightweightProxy
  21. //
  22. // An object which does nothing but stand in for another object and forward
  23. // messages (other than basic NSObject messages) to it, suitable for breaking
  24. // retain cycles. It does *not* retain the represented object, so the
  25. // represented object must be set to nil when that object is deallocated.
  26. //
  27. // Messages sent to a GTMLightweightProxy with no represented object set will
  28. // be silently discarded.
  29. //
  30. @interface GTMLightweightProxy : NSProxy {
  31. @private
  32. __weak id representedObject_;
  33. }
  34. // Initializes the object to represent |object|.
  35. - (id)initWithRepresentedObject:(id)object;
  36. // Gets the object that the proxy represents.
  37. - (id)representedObject;
  38. // Changes the proxy to represent |object|
  39. - (void)setRepresentedObject:(id)object;
  40. @end