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

reflect/test/c_vector.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_vector.hpp
00014 //
00015 // 4-Jul-2003  phamilton  Created
00016 //
00017 
00018 #ifndef incC_VECTOR
00019 #define incC_VECTOR
00020 
00021 // forwards
00022 #include <string>
00023 #include <vector>
00024 #include "c_base.hpp"
00025 #include "../../common/vector_object.hpp"
00026 #include "../vector_object.hpp"
00027 
00028 namespace reflect_test {
00029 
00030 class c_vector : 
00031         public c_base,
00032         public ph::common::vector_object_helper,
00033         public ph::reflect::vector_object_helper
00034 /*
00035         A composite object implemented as a vector of objects.
00036 */
00037 {
00038 public:
00039         c_vector(ph::common::object_base *outer, const std::string &name) :
00040                 c_base(outer, name)
00041                         {};
00042         
00043         // ph::common::object_base overrides.
00044         virtual bool accept(ph::common::member_visitor *v)
00045         { 
00046                 if (!c_base::accept(v))
00047                         return false;
00048                 return true; 
00049         }
00050         virtual bool accept(ph::common::const_member_visitor *v) const
00051         { 
00052                 if (!c_base::accept(v))
00053                         return false;
00054                 return true; 
00055         }
00056         virtual bool accept(ph::common::object_visitor *v)
00057         { 
00058                 if (!c_base::accept(v))
00059                         return false;
00060                 return helper_accept(this, &_vector, v); 
00061         }
00062         virtual bool accept(ph::common::const_object_visitor *v) const
00063         { 
00064                 if (!c_base::accept(v))
00065                         return false;
00066                 return helper_accept(this, &_vector, v); 
00067         }
00068 
00069         // ph::common::composite_object_base overrides.
00070         virtual bool add(ph::common::object_base *obj, bool own)
00071                 { return helper_add(this, obj, own, owned()); }
00072         virtual bool remove(ph::common::object_base *obj)
00073                 { return helper_remove(obj); }
00074         virtual bool singleton() const
00075                 { return helper_singleton(); }
00076         virtual int count() const
00077                 { return helper_count(); }
00078 
00079         // ph::common::deletable_object_base overrides.
00080         virtual void delete_object() 
00081                 { helper_delete_object(owned()); }
00082 };
00083 
00084 };
00085 #endif // incC_VECTOR

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