5#ifndef ACCESSIBILITY_BASE_PLATFORM_DARWIN_SCOPED_NSOBJECT_H_
6#define ACCESSIBILITY_BASE_PLATFORM_DARWIN_SCOPED_NSOBJECT_H_
11#import <Foundation/NSObject.h>
16@class NSAutoreleasePool;
40template <
typename NST>
47 template <
typename NSU>
66 bool operator==(NST that)
const {
return object_ == that; }
67 bool operator!=(NST that)
const {
return object_ != that; }
69 operator NST()
const {
return object_; }
71 NST
get()
const {
return object_; }
74 NST temp = that.object_;
75 that.object_ = object_;
88 [[nodiscard]] NST release() {
103 return p1 == p2.
get();
108 return p1 != p2.
get();
111template <
typename NST>
118 template <
typename NSU>
135 template <
typename NSU>
scoped_nsobject & operator=(const scoped_nsobject< id > &that)
scoped_nsobject(id object=nil)
scoped_nsobject(const scoped_nsobject< id > &that)
scoped_nsobject(const scoped_nsobject< NSU > &that)
scoped_nsobject(NST *object=nil)
scoped_nsobject(const scoped_nsobject< NSU > &that)
scoped_nsobject(const scoped_nsobject< NST > &that)
scoped_nsobject & operator=(const scoped_nsobject< NST > &that)
scoped_nsprotocol(const scoped_nsprotocol< NSU > &that)
scoped_nsprotocol(const scoped_nsprotocol< NST > &that)
void swap(scoped_nsprotocol &that)
bool operator!=(NST that) const
bool operator==(NST that) const
void reset(NST object=nil)
scoped_nsprotocol & operator=(const scoped_nsprotocol< NST > &that)
scoped_nsprotocol(NST object=nil)
bool operator==(C p1, const scoped_nsprotocol< C > &p2)
void swap(scoped_nsprotocol< C > &p1, scoped_nsprotocol< C > &p2)
bool operator!=(C p1, const scoped_nsprotocol< C > &p2)
#define BASE_DISALLOW_COPY_AND_ASSIGN(TypeName)