OSDN Git Service

git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-shamshel@5516 1ed66053...
authorokada <okada@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Thu, 25 Dec 2008 10:13:06 +0000 (10:13 +0000)
committerokada <okada@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Thu, 25 Dec 2008 10:13:06 +0000 (10:13 +0000)
include/protocol_module_control.h
include/schedule_module_control.h

index 0e88be8..46dcf50 100644 (file)
 namespace l7vsd
 {
 
-class  protocol_module_control : public module_control_base
-{
+class  protocol_module_control : public module_control_base{
 public:
        typedef list<realserver>        realserverlist_type;
        typedef boost::function< realserverlist_type::iretarot( void ) >        rs_list_itr_func_type;
        typedef boost::function< void ( const LOG_LEVEL_TAG, const std::string ) >      logger_func_type;
        typedef boost::function< void ( std::string&, unsigned int* ) >                         replication_pay_memory_func_type;
 
-       struct  loadmodule_info
-       {
+       struct  protocol_module_info{
                unsigned int    ref_count;
-               protocol_module_base*   (*module_create)(logger_func_type);
-               void                                    (*module_restroy)(protocol_module_base*);
+               boost::function<protocol_module_base*(logger_func_type)>        create_func;
+               boost::function<void(protocol_module_base*)>                            destroy_func;
        };
 
 protected:
-       std::map<std::string,loadmodule_info>   loadmodule_map;
-       boost::mutex                                                    loadmodule_map_mutex;
+       std::map<std::string,protocol_module_info>      loadmodule_map;
+       boost::mutex                                                            loadmodule_map_mutex;
 
        protocol_module_control();
        protocol_module_control( const protocol_module_control& );
@@ -46,18 +44,9 @@ protected:
 public:
        static protocol_module_control& getInstance();
 
-       bool    load_module( const std::string& );
-       void    unload_module( const std::string& );
-
-       protocol_module_base*   create_module(
-                                                               std::string& modulename,
-                                                               rs_list_itr_func_type   rslist_begin,
-                                                               rs_list_itr_func_type   rslist_end,
-                                                               rs_list_itr_func_type   rslist_next,
-                                                               logger_func_type                inlog,
-                                                               replication_pay_memory_func_type        inpaymemory );
-       void    destroy_module( protocol_module_base* module_ptr );
+       protocol_module_base*   load_module( const std::string& modulename, logger_func_type inlog );
+       void                                    unload_module( const std::string& modulename, protocol_module_base* module_ptr );
 };
 
-};
+};     //namespace l7vsd
 #endif//PROTOCOL_MODULE_CONTROL
index 0138d67..bc99dfd 100644 (file)
@@ -22,19 +22,21 @@ namespace l7vsd
 class  schedule_module_control : public module_control_base
 {
 public:
-       typedef boost::function< void ( const LOG_LEVEL_TAG, const std::string ) >      logger_func_type;
-       typedef boost::function< void ( std::string&, unsigned int* ) >                         replication_pay_memory_func_type;
+       typedef boost::function< void ( const LOG_LEVEL_TAG, const unsigned int log_id, const std::string ) >
+                                                                               logger_func_type;
+       typedef boost::function< void ( std::string&, unsigned int* ) >
+                                                                               replication_pay_memory_func_type;
 
-       struct  module_info
+       struct  schedule_module_info
        {
                unsigned int    ref_count;
-               schedule_module_base*   (*module_create)(logger_func_type);
-               void                                    (*module_restroy)(protocol_module_base*);
+               boost::function<schedule_module_base*(logger_func_type)>        create_func;
+               boost::function<void(schedule_module_base*)>                            destroy_func;
        };
 
 protected:
-       std::map<std::string,module_info>       loadmodule_map;
-       boost::mutex                                            loadmodule_map_mutex;
+       std::map<std::string,schedule_module_info>      loadmodule_map;
+       boost::mutex                                                            loadmodule_map_mutex;
 
        schedule_module_control();
        schedule_module_control( const schedule_module_control& );
@@ -43,15 +45,9 @@ protected:
 public:
        static schedule_module_control& getInstance();
 
-       bool    load_module( const std::string& modulename );
-       void    unload_module( const std::string&       modulename );
-
-       schedule_module_base*   create_module(
-                                                               std::string& modulename,
-                                                               logger_func_type        inlog,
-                                                               replication_pay_memory_func_type        inpaymemory );
-       void    destroy_module( schedule_module_base* module_ptr );
+       schedule_module_base*   load_module( const std::string& modulename, logger_func_type inlog );
+       void                                    unload_module( const std::string& modulename, schedule_module_base* module_ptr );
 };
 
-};
+};     //namespace l7vsd
 #endif//SCHEDULE_MODULE_CONTROL