00001
00002
00003
00004
00005
00006
00007
00008 #ifndef incXMLOBJ_GENERIC
00009 #define incXMLOBJ_GENERIC
00010
00011
00012 #include "../xmlobj.hpp"
00013 #include "../xmlobj_vector.hpp"
00014 #include "boost/shared_ptr.hpp"
00015 #include <vector>
00016 #include <map>
00017 #include <string>
00018
00019 namespace ph {
00020 namespace xmlobj {
00021 namespace generic {
00022
00023 class XMLOBJ_DECL generic : public xmlobj
00024
00025
00026
00027
00028 {
00029 public:
00030 generic(const std::string &type, const std::string &name) :
00031 xmlobj(type, name)
00032 {};
00033
00034
00035 void copy(const generic &obj)
00036 { xmlobj::xmlobj::copy(obj); }
00037
00038
00039 virtual bool accept(ph::common::object_name_visitor *v) const;
00040 virtual bool accept(ph::common::member_visitor *v);
00041 virtual bool accept(ph::common::const_member_visitor *v) const;
00042 virtual bool accept(ph::common::object_visitor *v);
00043 virtual bool accept(ph::common::const_object_visitor *v) const;
00044 virtual ph::common::object_base *clone(
00045 const std::string &name, ph::common::cloneable_object_context *context) const;
00046
00047
00048 virtual ph::common::object_base *get_composite_object(const std::string &name);
00049 virtual bool has(const std::string &name) const;
00050 virtual void set(const std::string &name, const std::string &value);
00051
00052
00053 virtual bool is_any_object()
00054 { return true; }
00055
00056 private:
00057 std::vector<boost::shared_ptr<xmlobj_vector> > _composites;
00058 std::map<std::string, std::string> _members;
00059 };
00060
00061 };
00062 };
00063 };
00064
00065 #endif // incXMLOBJ_GENERIC