Skip to content

Commit

Permalink
Improve #include structure of commands ECFLOW-1932
Browse files Browse the repository at this point in the history
We split each command class into a separate header/source file, in order to reduce the cognitive load necessary to find each command in the code base, improve the readability of the code, and also limit the incremental compilation time required when changing a single command.
  • Loading branch information
marcosbento authored Dec 8, 2023
2 parents 6689ac7 + d556f9a commit 7d4b289
Show file tree
Hide file tree
Showing 119 changed files with 5,325 additions and 3,721 deletions.
110 changes: 78 additions & 32 deletions Base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,47 @@ set(srcs
$<$<BOOL:${OPENSSL_FOUND}>:src/ecflow/base/ssl_connection.hpp>
$<$<BOOL:${OPENSSL_FOUND}>:src/ecflow/base/SslClient.hpp>
src/ecflow/base/cts/ClientToServerCmd.hpp
src/ecflow/base/cts/CtsApi.hpp
src/ecflow/base/cts/CtsCmdRegistry.hpp
src/ecflow/base/cts/EditHistoryMgr.hpp
src/ecflow/base/cts/TaskApi.hpp
src/ecflow/base/cts/task/AbortCmd.hpp
src/ecflow/base/cts/task/CompleteCmd.hpp
src/ecflow/base/cts/task/CtsWaitCmd.hpp
src/ecflow/base/cts/task/EventCmd.hpp
src/ecflow/base/cts/task/InitCmd.hpp
src/ecflow/base/cts/task/LabelCmd.hpp
src/ecflow/base/cts/task/MeterCmd.hpp
src/ecflow/base/cts/task/QueueCmd.hpp
src/ecflow/base/cts/task/TaskApi.hpp
src/ecflow/base/cts/task/TaskCmd.hpp
src/ecflow/base/cts/user/AlterCmd.hpp
src/ecflow/base/cts/user/BeginCmd.hpp
src/ecflow/base/cts/user/CFileCmd.hpp
src/ecflow/base/cts/user/CheckPtCmd.hpp
src/ecflow/base/cts/user/ClientHandleCmd.hpp
src/ecflow/base/cts/user/CSyncCmd.hpp
src/ecflow/base/cts/user/CtsApi.hpp
src/ecflow/base/cts/user/CtsCmd.hpp
src/ecflow/base/cts/user/CtsNodeCmd.hpp
src/ecflow/base/cts/user/DeleteCmd.hpp
src/ecflow/base/cts/user/EditScriptCmd.hpp
src/ecflow/base/cts/user/ForceCmd.hpp
src/ecflow/base/cts/user/FreeDepCmd.hpp
src/ecflow/base/cts/user/GroupCTSCmd.hpp
src/ecflow/base/cts/user/LoadDefsCmd.hpp
src/ecflow/base/cts/user/LogCmd.hpp
src/ecflow/base/cts/user/LogMessageCmd.hpp
src/ecflow/base/cts/user/MoveCmd.hpp
src/ecflow/base/cts/user/OrderNodeCmd.hpp
src/ecflow/base/cts/user/PathsCmd.hpp
src/ecflow/base/cts/user/PlugCmd.hpp
src/ecflow/base/cts/user/QueryCmd.hpp
src/ecflow/base/cts/user/ReplaceNodeCmd.hpp
src/ecflow/base/cts/user/RequeueNodeCmd.hpp
src/ecflow/base/cts/user/RunNodeCmd.hpp
src/ecflow/base/cts/user/ServerVersionCmd.hpp
src/ecflow/base/cts/user/ShowCmd.hpp
src/ecflow/base/cts/user/UserCmd.hpp
src/ecflow/base/cts/user/ZombieCmd.hpp
src/ecflow/base/stc/BlockClientZombieCmd.hpp
src/ecflow/base/stc/DefsCache.hpp
src/ecflow/base/stc/DefsCmd.hpp
Expand Down Expand Up @@ -64,39 +101,48 @@ set(srcs
$<$<BOOL:${OPENSSL_FOUND}>:src/ecflow/base/Openssl.cpp>
$<$<BOOL:${OPENSSL_FOUND}>:src/ecflow/base/ssl_connection.cpp>
$<$<BOOL:${OPENSSL_FOUND}>:src/ecflow/base/SslClient.cpp>
src/ecflow/base/cts/AlterCmd.cpp
src/ecflow/base/cts/BeginCmd.cpp
src/ecflow/base/cts/CFileCmd.cpp
src/ecflow/base/cts/CSyncCmd.cpp
src/ecflow/base/cts/CheckPtCmd.cpp
src/ecflow/base/cts/ClientHandleCmd.cpp
src/ecflow/base/cts/ClientToServerCmd.cpp
src/ecflow/base/cts/CtsApi.cpp
src/ecflow/base/cts/CtsCmd.cpp
src/ecflow/base/cts/CtsCmdRegistry.cpp
src/ecflow/base/cts/CtsNodeCmd.cpp
src/ecflow/base/cts/DeleteCmd.cpp
src/ecflow/base/cts/EditHistoryMgr.cpp
src/ecflow/base/cts/EditScriptCmd.cpp
src/ecflow/base/cts/ForceCmd.cpp
src/ecflow/base/cts/FreeDepCmd.cpp
src/ecflow/base/cts/GroupCTSCmd.cpp
src/ecflow/base/cts/LoadDefsCmd.cpp
src/ecflow/base/cts/LogCmd.cpp
src/ecflow/base/cts/LogMessageCmd.cpp
src/ecflow/base/cts/OrderNodeCmd.cpp
src/ecflow/base/cts/PathsCmd.cpp
src/ecflow/base/cts/PlugCmd.cpp
src/ecflow/base/cts/QueryCmd.cpp
src/ecflow/base/cts/ReplaceNodeCmd.cpp
src/ecflow/base/cts/RequeueNodeCmd.cpp
src/ecflow/base/cts/RunNodeCmd.cpp
src/ecflow/base/cts/ServerVersionCmd.cpp
src/ecflow/base/cts/ShowCmd.cpp
src/ecflow/base/cts/TaskApi.cpp
src/ecflow/base/cts/TaskCmds.cpp
src/ecflow/base/cts/UserCmd.cpp
src/ecflow/base/cts/ZombieCmd.cpp
src/ecflow/base/cts/task/AbortCmd.cpp
src/ecflow/base/cts/task/CompleteCmd.cpp
src/ecflow/base/cts/task/CtsWaitCmd.cpp
src/ecflow/base/cts/task/EventCmd.cpp
src/ecflow/base/cts/task/InitCmd.cpp
src/ecflow/base/cts/task/LabelCmd.cpp
src/ecflow/base/cts/task/MeterCmd.cpp
src/ecflow/base/cts/task/QueueCmd.cpp
src/ecflow/base/cts/task/TaskApi.cpp
src/ecflow/base/cts/task/TaskCmd.cpp
src/ecflow/base/cts/user/AlterCmd.cpp
src/ecflow/base/cts/user/BeginCmd.cpp
src/ecflow/base/cts/user/CFileCmd.cpp
src/ecflow/base/cts/user/CSyncCmd.cpp
src/ecflow/base/cts/user/CheckPtCmd.cpp
src/ecflow/base/cts/user/ClientHandleCmd.cpp
src/ecflow/base/cts/user/CtsApi.cpp
src/ecflow/base/cts/user/CtsCmd.cpp
src/ecflow/base/cts/user/CtsNodeCmd.cpp
src/ecflow/base/cts/user/DeleteCmd.cpp
src/ecflow/base/cts/user/EditScriptCmd.cpp
src/ecflow/base/cts/user/ForceCmd.cpp
src/ecflow/base/cts/user/FreeDepCmd.cpp
src/ecflow/base/cts/user/GroupCTSCmd.cpp
src/ecflow/base/cts/user/LoadDefsCmd.cpp
src/ecflow/base/cts/user/LogCmd.cpp
src/ecflow/base/cts/user/LogMessageCmd.cpp
src/ecflow/base/cts/user/MoveCmd.cpp
src/ecflow/base/cts/user/OrderNodeCmd.cpp
src/ecflow/base/cts/user/PathsCmd.cpp
src/ecflow/base/cts/user/PlugCmd.cpp
src/ecflow/base/cts/user/QueryCmd.cpp
src/ecflow/base/cts/user/ReplaceNodeCmd.cpp
src/ecflow/base/cts/user/RequeueNodeCmd.cpp
src/ecflow/base/cts/user/RunNodeCmd.cpp
src/ecflow/base/cts/user/ServerVersionCmd.cpp
src/ecflow/base/cts/user/ShowCmd.cpp
src/ecflow/base/cts/user/UserCmd.cpp
src/ecflow/base/cts/user/ZombieCmd.cpp
src/ecflow/base/stc/BlockClientZombieCmd.cpp
src/ecflow/base/stc/DefsCache.cpp
src/ecflow/base/stc/DefsCmd.cpp
Expand Down
3 changes: 2 additions & 1 deletion Base/src/ecflow/base/ZombieCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#include <stdexcept>

#include "ecflow/base/AbstractServer.hpp"
#include "ecflow/base/cts/ClientToServerCmd.hpp"
#include "ecflow/base/cts/task/TaskCmd.hpp"
#include "ecflow/base/stc/PreAllocatedReply.hpp"
#include "ecflow/node/Defs.hpp"
#include "ecflow/node/Submittable.hpp"
#include "ecflow/node/Suite.hpp"
Expand Down
37 changes: 1 addition & 36 deletions Base/src/ecflow/base/cts/ClientToServerCmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "ecflow/base/AbstractServer.hpp"
#include "ecflow/base/cts/EditHistoryMgr.hpp"
#include "ecflow/base/stc/PreAllocatedReply.hpp"
#include "ecflow/base/stc/ServerToClientCmd.hpp"
#include "ecflow/core/Calendar.hpp"
#include "ecflow/core/Host.hpp"
Expand Down Expand Up @@ -225,39 +226,3 @@ void ClientToServerCmd::add_delete_edit_history(Defs* defs, const std::string& p
print(ss, path); // custom print
defs->add_edit_history(Str::ROOT_PATH(), ss);
}

CEREAL_REGISTER_TYPE(ServerVersionCmd)
CEREAL_REGISTER_TYPE(CtsCmd)
CEREAL_REGISTER_TYPE(CSyncCmd)
CEREAL_REGISTER_TYPE(ClientHandleCmd)
CEREAL_REGISTER_TYPE(CtsNodeCmd)
CEREAL_REGISTER_TYPE(PathsCmd)
CEREAL_REGISTER_TYPE(DeleteCmd)
CEREAL_REGISTER_TYPE(CheckPtCmd)
CEREAL_REGISTER_TYPE(LoadDefsCmd)
CEREAL_REGISTER_TYPE(LogCmd)
CEREAL_REGISTER_TYPE(LogMessageCmd)
CEREAL_REGISTER_TYPE(BeginCmd)
CEREAL_REGISTER_TYPE(ZombieCmd)
CEREAL_REGISTER_TYPE(InitCmd)
CEREAL_REGISTER_TYPE(EventCmd)
CEREAL_REGISTER_TYPE(MeterCmd)
CEREAL_REGISTER_TYPE(LabelCmd)
CEREAL_REGISTER_TYPE(QueueCmd)
CEREAL_REGISTER_TYPE(AbortCmd)
CEREAL_REGISTER_TYPE(CtsWaitCmd)
CEREAL_REGISTER_TYPE(CompleteCmd)
CEREAL_REGISTER_TYPE(RequeueNodeCmd)
CEREAL_REGISTER_TYPE(OrderNodeCmd)
CEREAL_REGISTER_TYPE(RunNodeCmd)
CEREAL_REGISTER_TYPE(ReplaceNodeCmd)
CEREAL_REGISTER_TYPE(ForceCmd)
CEREAL_REGISTER_TYPE(FreeDepCmd)
CEREAL_REGISTER_TYPE(CFileCmd)
CEREAL_REGISTER_TYPE(EditScriptCmd)
CEREAL_REGISTER_TYPE(PlugCmd)
CEREAL_REGISTER_TYPE(AlterCmd)
CEREAL_REGISTER_TYPE(MoveCmd)
CEREAL_REGISTER_TYPE(GroupCTSCmd)
CEREAL_REGISTER_TYPE(ShowCmd)
CEREAL_REGISTER_TYPE(QueryCmd)
Loading

0 comments on commit 7d4b289

Please sign in to comment.