diff --git a/src/actor.h b/src/actor.h index 86378d0..0fb51c3 100644 --- a/src/actor.h +++ b/src/actor.h @@ -1,4 +1,4 @@ -#pragma once + #include #include #include @@ -7,10 +7,6 @@ #include "functiontraits.h" -/** - * @brief Actor class, which encapsulates the event model - * @note enable_shared_from_this allows us to get safe Pointers internally - */ class Actor : public std::enable_shared_from_this { public: @@ -21,27 +17,18 @@ public: Actor(){} ~Actor(){} - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template void operator+=(Function&& function_any) noexcept { m_invokeFunctionWapper = { std::bind(&invoker::apply, function_any, std::placeholders::_1, std::placeholders::_2) }; } - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template void registerFunction(Function&& function_any) noexcept { m_invokeFunctionWapper = { std::bind(&invoker::apply, function_any, std::placeholders::_1, std::placeholders::_2) }; } - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template void invoke(Args&& ... args) const noexcept { @@ -49,9 +36,6 @@ public: m_invokeFunctionWapper(&args_tuple, nullptr); } - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template R invoke(Args&& ...args) const { @@ -66,12 +50,8 @@ public: return return_value; } - Ptr getSharedPtr() - { - return shared_from_this(); - } - public: + /** * @brief This struct encapsulates a function, * essentially storing the return value and parameters in two variables diff --git a/src/actorprocessor.cpp b/src/actorprocessor.cpp index 099d1f6..6dfd1f4 100644 --- a/src/actorprocessor.cpp +++ b/src/actorprocessor.cpp @@ -1,11 +1,9 @@ -#include "actorprocessor.h" +#include "actorprocessor.h" + ActorProcessor::ActorProcessor(): m_actorMap(new std::unordered_map) {} -/** - * @brief - */ ActorProcessor::~ActorProcessor() { for (auto& item : (*m_actorMap)) @@ -17,17 +15,11 @@ ActorProcessor::~ActorProcessor() delete m_actorMap; } -/** - * @brief - */ void ActorProcessor::registerActor(const std::string &route, Actor *actor) { m_actorMap->insert(std::make_pair(route,actor)); } -/** - * @brief - */ void ActorProcessor::removeActor(const std::string &route) { auto iter = (*m_actorMap).find(route); @@ -38,9 +30,6 @@ void ActorProcessor::removeActor(const std::string &route) } } -/** - * @brief - */ Actor *ActorProcessor::findActor(const std::string &route) { auto iter = (*m_actorMap).find(route); @@ -51,9 +40,7 @@ Actor *ActorProcessor::findActor(const std::string &route) return nullptr; } -/** - * @brief - */ + bool ActorProcessor::resetActor(const std::string &route, Actor *actor) { auto iter = (*m_actorMap).find(route); diff --git a/src/actorprocessor.h b/src/actorprocessor.h index 9026909..def5b06 100644 --- a/src/actorprocessor.h +++ b/src/actorprocessor.h @@ -1,5 +1,5 @@ -#ifndef EVENTPROCESSOR_H -#define EVENTPROCESSOR_H +#ifndef _PROCESSOR_H +#define _PROCESSOR_H #include #include @@ -25,9 +25,6 @@ public: (*m_actorMap)[route]->invoke(std::forward(args)...); } - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template R invoke(const std::string& route,Args&& ...args) const { @@ -36,30 +33,16 @@ public: return nullptr; } - /** - * @brief 注册一个actor,其中route是唯一的 - */ void registerActor(const std::string& route, Actor*actor); - /** - * @brief 删除一个actor - */ void removeActor(const std::string& route); - - /** - * @brief 查找一个actor, 返回其指针 - */ Actor* findActor(const std::string& route); - - /** - * @brief 重置一个actor,注意原有的actor会被删除 - */ bool resetActor(const std::string& route,Actor*actor); private: std::unordered_map* m_actorMap; + private: - // not allow copy constroct ActorProcessor(ActorProcessor&&)=delete; ActorProcessor& operator=(const ActorProcessor&)=delete; }; diff --git a/src/plugin/filetreeview/abstractfile.cpp b/src/plugin/filetreeview/abstractfile.cpp deleted file mode 100644 index 9b8673f..0000000 --- a/src/plugin/filetreeview/abstractfile.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "abstractfile.h" - -AbstractFile::AbstractFile() -{ - -} diff --git a/src/plugin/filetreeview/abstractfile.h b/src/plugin/filetreeview/abstractfile.h deleted file mode 100644 index 94ae7dc..0000000 --- a/src/plugin/filetreeview/abstractfile.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef ABSTRACTFILE_H -#define ABSTRACTFILE_H - - -class AbstractFile -{ -public: - AbstractFile(); -}; - -#endif // ABSTRACTFILE_H diff --git a/src/plugin/filetreeview/actor.h b/src/plugin/filetreeview/actor.h index 70cd9ff..30b6f00 100644 --- a/src/plugin/filetreeview/actor.h +++ b/src/plugin/filetreeview/actor.h @@ -1,6 +1,6 @@ /** - ** This file is part of ndd file tree view plugin - ** Copyright 2022-2023 ji wang . + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as @@ -16,6 +16,7 @@ ** along with this program. If not, see . **/ + #pragma once #include #include diff --git a/src/plugin/filetreeview/actorprocessor.cpp b/src/plugin/filetreeview/actorprocessor.cpp index 099d1f6..96af367 100644 --- a/src/plugin/filetreeview/actorprocessor.cpp +++ b/src/plugin/filetreeview/actorprocessor.cpp @@ -1,3 +1,22 @@ +/** + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU Lesser General Public License as + ** published by the Free Software Foundation, either version 3 of the + ** License, or (at your option) any later version. + ** + ** This program 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 + ** GNU Lesser General Public License for more details. + ** + ** You should have received a copy of the GNU Lesser General Public License + ** along with this program. If not, see . + **/ + + #include "actorprocessor.h" ActorProcessor::ActorProcessor(): m_actorMap(new std::unordered_map) diff --git a/src/plugin/filetreeview/actorprocessor.h b/src/plugin/filetreeview/actorprocessor.h index d057e6d..76c6035 100644 --- a/src/plugin/filetreeview/actorprocessor.h +++ b/src/plugin/filetreeview/actorprocessor.h @@ -1,5 +1,24 @@ -#ifndef EVENTPROCESSOR_H -#define EVENTPROCESSOR_H +/** + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU Lesser General Public License as + ** published by the Free Software Foundation, either version 3 of the + ** License, or (at your option) any later version. + ** + ** This program 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 + ** GNU Lesser General Public License for more details. + ** + ** You should have received a copy of the GNU Lesser General Public License + ** along with this program. If not, see . + **/ + + +#ifndef _PROCESSOR_H +#define _PROCESSOR_H #include #include @@ -15,9 +34,6 @@ public: ~ActorProcessor(); public: - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template void invoke(const std::string& route,Args&& ... args) const noexcept { @@ -25,9 +41,6 @@ public: (*m_actorMap)[route]->invoke(std::forward(args)...); } - /** - * @brief Register the callback function and construct the anonymous function with std::bind - */ template R invoke(const std::string& route,Args&& ...args) const { @@ -36,24 +49,12 @@ public: return nullptr; } - /** - * @brief 注册一个actor,其中route是唯一的 - */ void registerActor(const std::string& route, Actor*actor); - /** - * @brief 删除一个actor - */ void removeActor(const std::string& route); - /** - * @brief 查找一个actor, 返回其指针 - */ Actor* findActor(const std::string& route); - /** - * @brief 重置一个actor,注意原有的actor会被删除 - */ bool resetActor(const std::string& route,Actor*actor); private: diff --git a/src/plugin/filetreeview/filetreeview.cpp b/src/plugin/filetreeview/filetreeview.cpp index a1afb12..1259296 100644 --- a/src/plugin/filetreeview/filetreeview.cpp +++ b/src/plugin/filetreeview/filetreeview.cpp @@ -1,6 +1,6 @@ /** - ** This file is part of the NoteBook project. - ** Copyright 2022 ji wang . + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as diff --git a/src/plugin/filetreeview/filetreeview.h b/src/plugin/filetreeview/filetreeview.h index 0a0e5e1..9a1eda2 100644 --- a/src/plugin/filetreeview/filetreeview.h +++ b/src/plugin/filetreeview/filetreeview.h @@ -1,6 +1,6 @@ /** - ** This file is part of the NoteBook project. - ** Copyright 2022 ji wang . + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . ** ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU Lesser General Public License as @@ -16,7 +16,6 @@ ** along with this program. If not, see . **/ - #ifndef WORKSPACE_H #define WORKSPACE_H diff --git a/src/plugin/filetreeview/filetreeviewplugin.cpp b/src/plugin/filetreeview/filetreeviewplugin.cpp index 97eda35..83efcec 100644 --- a/src/plugin/filetreeview/filetreeviewplugin.cpp +++ b/src/plugin/filetreeview/filetreeviewplugin.cpp @@ -8,6 +8,24 @@ #include #include #include +/** + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU Lesser General Public License as + ** published by the Free Software Foundation, either version 3 of the + ** License, or (at your option) any later version. + ** + ** This program 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 + ** GNU Lesser General Public License for more details. + ** + ** You should have received a copy of the GNU Lesser General Public License + ** along with this program. If not, see . + **/ + #include diff --git a/src/plugin/filetreeview/filetreeviewplugin.h b/src/plugin/filetreeview/filetreeviewplugin.h index fd35186..336bbc6 100644 --- a/src/plugin/filetreeview/filetreeviewplugin.h +++ b/src/plugin/filetreeview/filetreeviewplugin.h @@ -1,4 +1,23 @@ -#ifndef FILETREEWIDGET_H +/** + ** This file is part of ndd plugin file tree view + ** Copyright ji wang . + ** + ** This program is free software: you can redistribute it and/or modify + ** it under the terms of the GNU Lesser General Public License as + ** published by the Free Software Foundation, either version 3 of the + ** License, or (at your option) any later version. + ** + ** This program 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 + ** GNU Lesser General Public License for more details. + ** + ** You should have received a copy of the GNU Lesser General Public License + ** along with this program. If not, see . + **/ + + +#ifndef FILETREEWIDGET_H #define FILETREEWIDGET_H #include