Code Search for Developers
 
 
  

proxy.h from osgDesigner at Krugle


Show proxy.h syntax highlighted

#ifndef __GEN_PROG_PLUGIN_PROXY_H__
#define __GEN_PROG_PLUGIN_PROXY_H__ 1

#include <gen_prog/plugin/registry.h>

#include <gen_prog/plugin/detail/thread_locker.h>
#include <gen_prog/plugin/detail/singleton.h>

#include <iostream>

namespace gen_prog
{
    namespace plugin
    {
//        namespace detail
//        {
//            template < class protected_type , class friend_type >
//            struct protected_inserter : public protected_type 
//            {
//                template < typename T >
//                struct identity
//                {
//                  typedef T type;
//                };
//                
//                friend class identity< friend_type >::type;  
//            };
//        }
        
        /* registry_proxy is a proxy to registre data in the registry
         *     @\param D the type to registre
         *     @\param R the registry where registre the type must implemente the following function
         *          
         */ 
        
        template < typename D, typename R /*= registry< typename D::base_type >*/ >
        class proxy
        {
                typedef D                                                               derived_type;
                typedef R                                                               singleton_registry_type;
            
            public:
            
                proxy()
                :   _derived(new derived_type)
                {
                    //detail::protected_inserter< registry_type, self_type > * unprotectedRegistry = registry_accessor_type::instance();
                    //unprotectedRegistry->reg(_derived.get());
                    singleton_registry_type::instance()->reg(_derived.get());
                }
                ~proxy()
                {
                    //detail::protected_inserter< registry_type, self_type > * unprotectedRegistry = registry_accessor_type::instance();
                    //unprotectedRegistry->reg(_derived.get());
                    singleton_registry_type::instance()->unreg(_derived.get());
                }
                
            private:
                osg::ref_ptr< derived_type > _derived;
        };
    }   
}

#endif // ** __GEN_PROG_PLUGIN_PROXY_H__ ** //




See more files for this project here

osgDesigner

osgDesigner is a graphical tool used to modify an OpenSceneGraph (OSG) scene using the osgIntrospection framework. OpenSceneGraph developpers will be able to extend osgDesigner at need using (editor | render | osgIntrospection wrapper) plugin system.

Project homepage: http://sourceforge.net/projects/osgdesigner
Programming language(s): C++,Shell Script
License: other

  detail/
    dynamic_library_identifier.h
    singleton.h
    thread_locker.h
    tracker.h
  dynamic_library.h
  dynamic_library_manager.h
  dynamic_library_manager_traits.h
  plugin_manager.h
  proxy.h
  registry.h