00001 /* 00002 ot_lib - Object Type Library 00003 Copyright (C) 2002 Alessandro Bonfanti 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Alessandro Bonfanti 00020 xjbon@tin.it 00021 */ 00022 00023 00024 #ifndef OT_CONTAINER_ELEMENT_H 00025 #define OT_CONTAINER_ELEMENT_H 00026 00027 00028 class ot_container_element 00029 { 00030 00031 private: 00032 00033 auto_ptr<ot_obj> m_data; 00034 00035 00036 public: 00037 00038 ot_container_element(const ot_obj *data=0); 00039 00040 ot_container_element(const ot_obj &data); 00041 00042 ot_container_element(const ot_container_element &c); 00043 00044 virtual ~ot_container_element(void); 00045 00046 bool operator == (const ot_container_element &r) const; 00047 00048 bool operator != (const ot_container_element &r) const; 00049 00050 bool operator == (const ot_obj &r) const; 00051 00052 bool operator != (const ot_obj &r) const; 00053 00054 const ot_container_element & operator = (const ot_container_element &r); 00055 00056 const ot_container_element & operator = (ot_obj *r); 00057 00058 bool set(const ot_obj *data); 00059 00060 const ot_obj * get(void) const; 00061 00062 ot_obj * getPtr(void); 00063 00064 const ot_obj * operator -> (void); 00065 00066 operator const ot_obj & (void) {return(*m_data.get());} 00067 00068 //operator const ot_obj * (void) {return(m_data.get());} 00069 }; 00070 00071 #endif