00001 /* 00002 * Copyright (c) 1997 00003 * Silicon Graphics Computer Systems, Inc. 00004 * 00005 * Permission to use, copy, modify, distribute and sell this software 00006 * and its documentation for any purpose is hereby granted without fee, 00007 * provided that the above copyright notice appear in all copies and 00008 * that both that copyright notice and this permission notice appear 00009 * in supporting documentation. Silicon Graphics makes no 00010 * representations about the suitability of this software for any 00011 * purpose. It is provided "as is" without express or implied warranty. 00012 * 00013 * Heavily modified by KOM/Darmstadt University of Technology, 2000 00014 */ 00015 #ifndef _R_PTR_PROXY_H 00016 #define _R_PTR_PROXY_H 00017 00018 #include <assert.h> 00019 00020 #include "MNRefProxy.h" 00021 00026 class MNPtrProxy 00027 { 00028 // XXX this class should be rewritten. 00029 friend class MNRefProxy; 00030 MNRope* _M_root; // The whole rope. 00031 size_t _M_pos; 00032 public: 00033 MNPtrProxy(const MNRefProxy& __x); 00034 MNPtrProxy(const MNPtrProxy& __x); 00035 MNPtrProxy(); 00036 MNPtrProxy(uchar_t* __x); 00037 00038 MNPtrProxy& operator= (const MNPtrProxy& __x); 00039 MNRefProxy operator*() const; 00040 00041 friend bool operator== (const MNPtrProxy& __x, 00042 const MNPtrProxy& __y); 00043 }; 00044 00045 inline bool operator== (const MNPtrProxy& __x, 00046 const MNPtrProxy& __y) 00047 { 00048 return (__x._M_pos == __y._M_pos && __x._M_root == __y._M_root); 00049 } 00050 00051 inline bool operator!= (const MNPtrProxy& __x, 00052 const MNPtrProxy& __y) 00053 { 00054 return !(__x == __y); 00055 } 00056 00058 00059 #endif /* _R_PTR_PROXY_H */ 00060