#pragma once #include "base.h" #include "lib_begin.h" namespace cgv { namespace base { class CGV_API named; /// ref counted pointer to a node typedef data::ref_ptr named_ptr; /** base class for all gui types */ class CGV_API named : public base { protected: /// declare named_ptr to be a friend class friend class data::ref_ptr; /// store the name as a string std::string name; public: /// construct from name named(const std::string& name = ""); /// return the parent node const std::string& get_name() const; /// set a new parent node void set_name(const std::string& _name); /// cast upward to named data::ref_ptr get_named(); /// overload to return the type name of this object std::string get_type_name() const; }; template <> struct cast_helper { inline static data::ref_ptr cast(base* b) { return b->get_named(); } }; #if _MSC_VER >= 1400 CGV_TEMPLATE template class CGV_API data::ref_ptr; #endif } } #include