Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

reflect/test/c_ref.hpp

Go to the documentation of this file.
00001 //
00002 // Copyright (c) 2003
00003 // Paul Hamilton; pHamtec P/L
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 appears in all copies and 
00008 // that both the copyright notice and this permission notice appear in 
00009 // supporting documentation. No representations are made about the 
00010 // suitability of this software for any purpose. It is provided "as is" 
00011 // without express or implied warranty.
00012 //
00013 // c_ref.hpp
00014 //
00015 // 4-Jul-2003  phamilton  Created
00016 //
00017 
00018 #ifndef incC_REF
00019 #define incC_REF
00020 
00021 // forwards
00022 #include <string>
00023 #include "c_base.hpp"
00024 #include "../../common/ref_object.hpp"
00025 #include "../ref_object.hpp"
00026 
00027 namespace reflect_test {
00028 
00029 class c_ref : 
00030         public c_base,
00031         public ph::common::ref_object_helper,
00032         public ph::reflect::ref_object_helper
00033 /*
00034         A composite object implemented as a reference to a single object.
00035 */
00036 {
00037 public:
00038         c_ref(ph::common::object_base *outer, const std::string &name) :
00039                 c_base(outer, name)
00040                         {};
00041         
00042         // visitable_object_base overrides.
00043         virtual bool accept(ph::common::member_visitor *v)
00044         { 
00045                 if (!c_base::accept(v))
00046                         return false;
00047                 return true; 
00048         }
00049         virtual bool accept(ph::common::const_member_visitor *v) const
00050         { 
00051                 if (!c_base::accept(v))
00052                         return false;
00053                 return true; 
00054         }
00055         virtual bool accept(ph::common::object_visitor *v)
00056         { 
00057                 if (!c_base::accept(v))
00058                         return false;
00059                 return helper_accept(this, _obj, v); 
00060         }
00061         virtual bool accept(ph::common::const_object_visitor *v) const
00062         { 
00063                 if (!c_base::accept(v))
00064                         return false;
00065                 return helper_accept(this, _obj, v); 
00066         }
00067 
00068         // ph::common::composite_object_base overrides.
00069         virtual bool add(ph::common::object_base *obj, bool own)
00070                 { return helper_add(this, obj, own, owned()); }
00071         virtual bool remove(ph::common::object_base *obj)
00072                 { return helper_remove(obj); }
00073         virtual bool singleton() const
00074                 { return helper_singleton(); }
00075         virtual int count() const
00076                 { return helper_count(); }
00077 
00078         // ph::common::deletable_object_base overrides.
00079         virtual void delete_object() 
00080                 { helper_delete_object(owned()); }
00081 };
00082 
00083 };
00084 
00085 #endif // incC_REF

Generated on Wed Apr 5 22:03:22 2006 for cppxmlobj by  doxygen 1.4.3