]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Add ModeHandler::IsListModeBase() and MC_LIST
[user/henk/code/inspircd.git] / include / modules.h
index f3f40d458f1c9cb6006c726062d31561c96c5841..d7b46ad4834b6552333605b79010396b9dec7b9a 100644 (file)
@@ -1168,6 +1168,9 @@ typedef IntModuleList::iterator EventHandlerIter;
  */
 class CoreExport ModuleManager
 {
+ public:
+       typedef std::vector<ServiceProvider*> ServiceList;
+
  private:
        /** Holds a string describing the last module error to occur
         */
@@ -1187,6 +1190,15 @@ class CoreExport ModuleManager
        /** Internal unload module hook */
        bool CanUnload(Module*);
 
+       /** Loads all core modules (cmd_*)
+        */
+       void LoadCoreModules(std::map<std::string, ServiceList>& servicemap);
+
+       /** Calls the Prioritize() method in all loaded modules
+        * @return True if all went well, false if a dependency loop was detected
+        */
+       bool PrioritizeHooks();
+
  public:
        typedef std::map<std::string, Module*> ModuleMap;
 
@@ -1198,6 +1210,16 @@ class CoreExport ModuleManager
        /** List of data services keyed by name */
        std::multimap<std::string, ServiceProvider*> DataProviders;
 
+       /** A list of ServiceProviders waiting to be registered.
+        * Non-NULL when constructing a Module, NULL otherwise.
+        * When non-NULL ServiceProviders add themselves to this list on creation and the core
+        * automatically registers them (that is, call AddService()) after the Module is constructed,
+        * and before Module::init() is called.
+        * If a service is created after the construction of the Module (for example in init()) it
+        * has to be registered manually.
+        */
+       ServiceList* NewServices;
+
        /** Simple, bog-standard, boring constructor.
         */
        ModuleManager();
@@ -1319,6 +1341,11 @@ class CoreExport ModuleManager
        /** Unregister a service provided by a module */
        void DelService(ServiceProvider&);
 
+       /** Register all services in a given ServiceList
+        * @param list The list containing the services to register
+        */
+       void AddServices(const ServiceList& list);
+
        inline void AddServices(ServiceProvider** list, int count)
        {
                for(int i=0; i < count; i++)
@@ -1401,7 +1428,7 @@ struct AllModuleList {
        { \
                return new y; \
        } \
-       extern "C" const char inspircd_src_version[] = VERSION " " REVISION;
+       extern "C" DllExport const char inspircd_src_version[] = VERSION " " REVISION;
 #endif
 
 #define COMMAND_INIT(c) MODULE_INIT(CommandModule<c>)