Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/remove codegen #117

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SC_EXTENSIONS_DIRECTORY})
link_directories(${SC_BIN_PATH} ${SC_EXTENSIONS_DIRECTORY})

set(SC_MACHINE_PATH "${PARENT_DIR}/sc-machine/")
include("${SC_MACHINE_PATH}/cmake/codegen.cmake")
set(SC_CODEGEN_TOOL "${SC_BIN_PATH}/sc-code-generator")
set(CMAKE_MODULE_PATH "${SC_MACHINE_PATH}/cmake")

Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Remove codegen for agents
- Remove svn dependency
- Remove trunk folder when download git repository
- Remove storage parser
Binary file modified docs/images/components_init_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/components_install_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/components_search_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
424 changes: 212 additions & 212 deletions docs/images/gwf/agents.gwf

Large diffs are not rendered by default.

Binary file modified docs/images/specifications_search_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/main.pdf
Binary file not shown.
Binary file modified docs/main.synctex.gz
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно файл убрать

Binary file not shown.
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ target_link_libraries(sc-component-manager
LINK_PRIVATE console-interface
)
set(SC_COMPONENT_MANAGER_MODULE "${CMAKE_CURRENT_LIST_DIR}/module")
sc_codegen_ex(sc-component-manager "${SC_COMPONENT_MANAGER_MODULE}" "${SC_COMPONENT_MANAGER_MODULE}/generated")

if(${SC_CLANG_FORMAT_CODE})
target_clangformat_setup(sc-component-manager)
endif()
2 changes: 0 additions & 2 deletions src/manager/agents/common-module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ target_include_directories(common-lib
PUBLIC ${SC_KPM_SRC}
)

sc_codegen_ex(common-lib ${CMAKE_CURRENT_LIST_DIR}/module ${CMAKE_CURRENT_LIST_DIR}/generated)

if(${SC_CLANG_FORMAT_CODE})
target_clangformat_setup(common-lib)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#include <string>
#include <vector>

#include "sc-memory/sc_memory.hpp"
#include "sc-memory/sc_agent_context.hpp"

using CommandParameters = std::map<std::string, std::vector<std::string>>;

class ScComponentManagerCommand
{
public:
virtual ScAddrUnorderedSet Execute(ScMemoryContext * context, ScAddr const & actionAddr) = 0;
virtual ScAddrUnorderedSet Execute(ScAgentContext * context, ScAddr const & actionAddr) = 0;

virtual ~ScComponentManagerCommand() = default;
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class DownloaderGit : public Downloader
{
if (!sc_fs_create_directory(downloadPath.c_str()))
{
SC_LOG_ERROR("Can't download. Can't create folder. " << downloadPath);
SC_LOG_ERROR("Can't download file. Can't create folder. " << downloadPath);
return false;
}

Expand Down Expand Up @@ -83,7 +83,7 @@ class DownloaderGit : public Downloader
{
if (!sc_fs_create_directory(downloadPath.c_str()))
{
SC_LOG_ERROR("Can't download. Can't create folder. " << downloadPath);
SC_LOG_ERROR("Can't download repository. Can't create folder. " << downloadPath);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SC_LOG_ERROR("Can't download repository. Can't create folder. " << downloadPath);
SC_AGENT_LOG_ERROR("Can't download repository. Can't create folder. " << downloadPath);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

эту ерунду можно только в агентах использовать, я могу добавить DownloaderGit к сообщению

return false;
}

Expand Down
21 changes: 4 additions & 17 deletions src/manager/agents/common-module/module/common_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,13 @@

using namespace commonModule;

SC_IMPLEMENT_MODULE(CommonModule)
SC_MODULE_REGISTER(CommonModule);

sc_result CommonModule::InitializeImpl()
void CommonModule::Initialize(ScMemoryContext * context)
{
if (!CommonModule::InitGlobal())
{
SC_LOG_ERROR("CommonModule is deactivated");
return SC_RESULT_ERROR;
}
ScMemoryContext context;
keynodes::ScComponentManagerKeynodes::InitGlobal();
common_utils::CommonUtils::InitParametersMap();
if (!common_utils::CommonUtils::CheckIfFullMyselfDecompositionExists(context))
if (!common_utils::CommonUtils::CheckIfFullMyselfDecompositionExists(*context))
{
common_utils::CommonUtils::CreateMyselfDecomposition(context);
common_utils::CommonUtils::CreateMyselfDecomposition(*context);
}
return SC_RESULT_OK;
}

sc_result CommonModule::ShutdownImpl()
{
return SC_RESULT_OK;
}
10 changes: 2 additions & 8 deletions src/manager/agents/common-module/module/common_module.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@

#include "sc-memory/sc_module.hpp"

#include "common_module.generated.hpp"

namespace commonModule
{
class CommonModule : public ScModule
{
SC_CLASS(LoadOrder(100))
SC_GENERATED_BODY()

sc_result InitializeImpl() override;

sc_result ShutdownImpl() override;
public:
void Initialize(ScMemoryContext * context) override;
};
} // namespace commonModule

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,153 +6,114 @@

#pragma once

#include "sc-memory/sc_addr.hpp"
#include "sc-memory/sc_object.hpp"

#include "ScComponentManagerKeynodes.generated.hpp"
#include <sc-memory/sc_keynodes.hpp>

namespace keynodes
{
class ScComponentManagerKeynodes : public ScObject
class ScComponentManagerKeynodes : public ScKeynodes
{
SC_CLASS()
SC_GENERATED_BODY()

public:
SC_PROPERTY(Keynode("myself"), ForceCreate(ScType::NodeConst))
static ScAddr myself;
static inline ScKeynode const myself{"myself", ScType::NodeConst};

static inline ScKeynode const concept_reusable_component{"concept_reusable_component", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_reusable_component"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_reusable_component;
static inline ScKeynode const current_components_to_install{
"concept_current_components_to_install",
ScType::NodeConst};

SC_PROPERTY(Keynode("concept_current_components_to_install"), ForceCreate(ScType::NodeConst))
static ScAddr current_components_to_install;
static inline ScKeynode const concept_reusable_kb_component{"concept_reusable_kb_component", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_reusable_kb_component"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_reusable_kb_component;
static inline ScKeynode const concept_reusable_ps_component{"concept_reusable_ps_component", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_reusable_ps_component"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_reusable_ps_component;
static inline ScKeynode const concept_reusable_ui_component{"concept_reusable_ui_component", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_reusable_ui_component"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_reusable_ui_component;
static inline ScKeynode const concept_reusable_embedded_ostis_system{
"concept_reusable_embedded_ostis_system",
ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_reusable_embedded_ostis_system"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_reusable_embedded_ostis_system;
static inline ScKeynode const concept_repository{"concept_repository", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_repository"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_repository;
static inline ScKeynode const concept_reusable_component_specification{
"concept_reusable_component_specification",
ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_reusable_component_specification"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_reusable_component_specification;
static inline ScKeynode const concept_single_address{"concept_single_address", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_single_address"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_single_address;
static inline ScKeynode const concept_complex_address{"concept_complex_address", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_complex_address"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_complex_address;
static inline ScKeynode const concept_github_url{"concept_github_url", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_github_url"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_github_url;
static inline ScKeynode const concept_need_to_install_components{
"concept_need_to_install_components",
ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_need_to_install_components"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_need_to_install_components;
static inline ScKeynode const concept_google_drive_url{"concept_google_drive_url", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_google_drive_url"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_google_drive_url;
static inline ScKeynode const sc_model_of_knowledge_base{"sc_model_of_knowledge_base", ScType::NodeConstClass};

SC_PROPERTY(Keynode("sc_model_of_knowledge_base"), ForceCreate(ScType::NodeConstClass))
static ScAddr sc_model_of_knowledge_base;
static inline ScKeynode const sc_model_of_interface{"sc_model_of_interface", ScType::NodeConstClass};

SC_PROPERTY(Keynode("sc_model_of_interface"), ForceCreate(ScType::NodeConstClass))
static ScAddr sc_model_of_interface;
static inline ScKeynode const sc_model_of_problem_solver{"sc_model_of_problem_solver", ScType::NodeConstClass};

SC_PROPERTY(Keynode("sc_model_of_problem_solver"), ForceCreate(ScType::NodeConstClass))
static ScAddr sc_model_of_problem_solver;
static inline ScKeynode const concept_subsystems_set{"concept_subsystems_set", ScType::NodeConstClass};

SC_PROPERTY(Keynode("concept_subsystems_set"), ForceCreate(ScType::NodeConstClass))
static ScAddr concept_subsystems_set;
static inline ScKeynode const rrel_repositories_specifications{
"rrel_repositories_specifications",
ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_repositories_specifications"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_repositories_specifications;
static inline ScKeynode const rrel_components_specifications{"rrel_components_specifications", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_components_specifications"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_components_specifications;
static inline ScKeynode const nrel_authors{"nrel_authors", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_authors"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_authors;
static inline ScKeynode const nrel_explanation{"nrel_explanation", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_explanation"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_explanation;
static inline ScKeynode const nrel_note{"nrel_note", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_note"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_note;
static inline ScKeynode const nrel_purpose{"nrel_purpose", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_purpose"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_purpose;
static inline ScKeynode const nrel_key_sc_element{"nrel_key_sc_element", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_key_sc_element"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_key_sc_element;
static inline ScKeynode const nrel_component_address{"nrel_component_address", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_component_address"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_component_address;
static inline ScKeynode const nrel_component_dependencies{"nrel_component_dependencies", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_component_dependencies"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_component_dependencies;
static inline ScKeynode const nrel_installation_method{"nrel_installation_method", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_installation_method"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_installation_method;
static inline ScKeynode const nrel_alternative_addresses{"nrel_alternative_addresses", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_alternative_addresses"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_alternative_addresses;
static inline ScKeynode const nrel_repository_address{"nrel_repository_address", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_repository_address"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_repository_address;
static inline ScKeynode const nrel_installation_script{"nrel_installation_script", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_installation_script"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_installation_script;
static inline ScKeynode const nrel_decomposition{"nrel_decomposition", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_decomposition"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_decomposition;
static inline ScKeynode const nrel_ostis_system_decomposition{
"nrel_ostis_system_decomposition",
ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("nrel_ostis_system_decomposition"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr nrel_ostis_system_decomposition;
static inline ScKeynode const action_components_init{"action_components_init", ScType::NodeConstClass};

SC_PROPERTY(Keynode("action_components_init"), ForceCreate(ScType::NodeConstClass))
static ScAddr action_components_init;
static inline ScKeynode const action_components_search{"action_components_search", ScType::NodeConstClass};

SC_PROPERTY(Keynode("action_components_search"), ForceCreate(ScType::NodeConstClass))
static ScAddr action_components_search;
static inline ScKeynode const action_components_install{"action_components_install", ScType::NodeConstClass};

SC_PROPERTY(Keynode("action_components_install"), ForceCreate(ScType::NodeConstClass))
static ScAddr action_components_install;
static inline ScKeynode const rrel_author{"rrel_author", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_author"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_author;
static inline ScKeynode const rrel_class{"rrel_class", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_class"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_class;
static inline ScKeynode const rrel_sets{"rrel_sets", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_sets"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_sets;
static inline ScKeynode const rrel_components{"rrel_components", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_components"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_components;
static inline ScKeynode const rrel_explanation{"rrel_explanation", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_explanation"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_explanation;
static inline ScKeynode const rrel_identifier{"rrel_identifier", ScType::NodeConstRole};

SC_PROPERTY(Keynode("rrel_identifier"), ForceCreate(ScType::NodeConstRole))
static ScAddr rrel_identifier;
static inline ScKeynode const rrel_note{"rrel_note", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("rrel_note"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr rrel_note;
static inline ScKeynode const rrel_purpose{"rrel_purpose", ScType::NodeConstNoRole};

SC_PROPERTY(Keynode("rrel_purpose"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr rrel_purpose;

SC_PROPERTY(Keynode("rrel_main_idtf"), ForceCreate(ScType::NodeConstNoRole))
static ScAddr rrel_main_idtf;
static inline ScKeynode const rrel_main_idtf{"rrel_main_idtf", ScType::NodeConstNoRole};
};

} // namespace keynodes
Loading
Loading