/* -*-c++-*- osgPython - Copyright (C) 2006 Miguel Escriva Gregori * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #ifndef OSGPYTHON_NAMESPACE #define OSGPYTHON_NAMESPACE 1 #include #include #include "Base.h" namespace osgPython { class Namespace : public Base { public: Namespace(const std::string& ns = "") : _namespace(ns) {} virtual boost::python::object getAttr(const std::string&); inline std::string getNamespace() {return _namespace;} virtual std::string __str__() const { return _namespace; } virtual std::string __repr__() const { return "Namespace("+_namespace+")"; } inline std::vector getTypes() const {return Namespace::getAllTypes(_namespace);} static std::vector getAllTypes(const std::string& filter); static boost::python::object loadWrapper(const std::string& name); protected: Namespace(const std::string& ns, osgDB::DynamicLibrary* lib) : _namespace(ns) , _lib(lib) {} virtual ~Namespace() { } const std::string _namespace; osg::ref_ptr _lib; }; } //end of osgPython namespace #endif