Skip to content

Commit

Permalink
refactor: fw => tools, nodable => ndbl, async (class => functions)
Browse files Browse the repository at this point in the history
  • Loading branch information
berdal84 committed May 23, 2024
1 parent 6699c19 commit 8a9949d
Show file tree
Hide file tree
Showing 229 changed files with 1,479 additions and 1,418 deletions.
410 changes: 208 additions & 202 deletions CMakeLists.txt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions HOW-TO-BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

## Architecture

Nodable is split in two [src](./src/README.md):
- the [nodable](./src/nodable/README.md) project.
- the [framework](./src/fw/README.md) project.
Nodable sources are split in two folders under [./src](./src/README.md):
- [./src/ndbl](src/ndbl/README.md) project.
- [./src/tool](src/tools/README.md) project.

They both rely on external [libraries](./libs/README.md).

Expand Down
4 changes: 2 additions & 2 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Projects

### [`./framework`](./fw/README.md)
### [`./framework`](tools/README.md)

Framework libraries to develop applications (headless or gui) including an example.

### [`./nodable`](./nodable/README.md)
### [`./nodable`](ndbl/README.md)

Nodable application and libraries.

Expand Down
Empty file removed src/fw/core/CMakeLists.txt
Empty file.
27 changes: 0 additions & 27 deletions src/fw/core/assertions.h

This file was deleted.

24 changes: 0 additions & 24 deletions src/fw/core/async.h

This file was deleted.

68 changes: 0 additions & 68 deletions src/fw/gui/EventManager.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions src/fw/gui/gui.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions src/fw/gui/gui.h

This file was deleted.

19 changes: 19 additions & 0 deletions src/ndbl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Nodable

Contains the nodable app and its libraries.

### `./core`

Nodable core library based on [tools-core](../tools/core).

### `./gui`

Nodable graphic user interface library based on [tools-gui](../tools/gui).

### `./app`

Nodable application based on [ndbl-gui](./gui).

### `./cli`

Nodable experimental command line interface based on [ndbl-core](./core).
6 changes: 3 additions & 3 deletions src/nodable/app/main.cpp → src/ndbl/app/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "nodable/gui/Config.h"
#include "nodable/gui/Nodable.h"
#include "ndbl/gui/Config.h"
#include "ndbl/gui/Nodable.h"

using namespace fw;
using namespace tools;
using namespace ndbl;

int main(int argc, char *argv[])
Expand Down
25 changes: 4 additions & 21 deletions src/nodable/cli/CLI.cpp → src/ndbl/cli/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

#include <iostream>

#include "fw/core/reflection/reflection"
#include "nodable/core/language/Nodlang.h"
#include "ndbl/core/core.h"
#include "ndbl/core/language/Nodlang.h"
#include "tools/core/reflection/reflection"

using namespace ndbl;
using namespace fw;
using namespace tools;

REGISTER
{
Expand Down Expand Up @@ -42,24 +43,6 @@ CLI::~CLI()
delete m_asm_code;
}



int CLI::main(int argc, char* argv[])
{
log::set_verbosity(log::Verbosity_Warning);
Pool::init();

while (!should_stop())
{
update();
}

m_graph.clear();
Pool::shutdown();
LOG_FLUSH()
return 0;
}

bool CLI::should_stop() const
{
return m_should_stop;
Expand Down
15 changes: 7 additions & 8 deletions src/nodable/cli/CLI.h → src/ndbl/cli/CLI.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#include <memory>

#include "fw/core/reflection/reflection"
#include "tools/core/reflection/reflection"

#include "nodable/core/language/Nodlang.h"
#include "nodable/core/NodeFactory.h"
#include "nodable/core/Graph.h"
#include "nodable/core/VirtualMachine.h"
#include "nodable/core/assembly/Compiler.h"
#include "ndbl/core/language/Nodlang.h"
#include "ndbl/core/NodeFactory.h"
#include "ndbl/core/Graph.h"
#include "ndbl/core/VirtualMachine.h"
#include "ndbl/core/assembly/Compiler.h"

namespace ndbl
{
Expand All @@ -20,7 +20,6 @@ namespace ndbl
public:
CLI();
~CLI();
int main(int argc, char* argv[]);
bool should_stop() const;

// api
Expand Down Expand Up @@ -52,7 +51,7 @@ namespace ndbl
const assembly::Code* m_asm_code;
VirtualMachine m_virtual_machine;
bool m_auto_completion = false;
void log_function_call(const fw::variant &result, const fw::func_type *type) const;
void log_function_call(const tools::variant &result, const tools::func_type *type) const;

};
}
21 changes: 21 additions & 0 deletions src/ndbl/cli/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include "CLI.h"
#include "ndbl/core/core.h"

using tools::log;

int main(int argc, char *argv[])
{
ndbl::core_init();
log::set_verbosity(log::Verbosity_Warning );
{
ndbl::CLI cli;

while ( !cli.should_stop() )
{
cli.update();
}
}
ndbl::core_shutdown();
LOG_FLUSH()
return 0;
}
6 changes: 3 additions & 3 deletions src/nodable/gui/tests.cpp → src/ndbl/cli/tests.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <gtest/gtest.h>
#include "fw/core/log.h"
#include <fw/core/reflection/reflection>
#include "tools/core/log.h"
#include "tools/core/reflection/reflection"

using namespace fw;
using namespace tools;

int main(int argc, char **argv) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "Node.h"

using namespace ndbl;
using namespace fw;
using namespace tools;

REGISTER
{
Expand Down
10 changes: 5 additions & 5 deletions src/nodable/core/Component.h → src/ndbl/core/Component.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "fw/core/reflection/reflection"
#include "fw/core/memory/Pool.h"
#include "tools/core/reflection/reflection"
#include "tools/core/memory/Pool.h"

namespace ndbl
{
Expand All @@ -20,9 +20,9 @@ namespace ndbl
Component(Component&&) = default;
Component& operator=(Component&&) = default;
virtual ~Component() = default;
::fw::PoolID<Node> get_owner()const { return m_owner; }
virtual void set_owner(::fw::PoolID<Node> node);
::tools::PoolID<Node> get_owner()const { return m_owner; }
virtual void set_owner(::tools::PoolID<Node> node);
protected:
::fw::PoolID<Node> m_owner;
::tools::PoolID<Node> m_owner;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "Component.h"

using namespace ndbl;
using namespace fw;
using namespace tools;

void
ComponentBag::add(PoolID<Component> id)
Expand All @@ -20,7 +20,7 @@ void
ComponentBag::remove(PoolID<Component> component)
{
auto found = std::find(m_components.begin(), m_components.end(), component );
FW_EXPECT(found != m_components.end(), "Component can't be found it those components");
EXPECT(found != m_components.end(), "Component can't be found it those components");
m_components_by_type.erase(component->get_type()->id());
m_components.erase(found);
component->set_owner({});
Expand Down
Loading

0 comments on commit 8a9949d

Please sign in to comment.