-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from alexge50/develop
v0.2.0
- Loading branch information
Showing
151 changed files
with
4,438 additions
and
2,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule nodeeditor
updated
from 1151b5 to 0eb67c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// Created by alex on 7/14/19. | ||
// | ||
|
||
#ifndef GIE_ERROR_H | ||
#define GIE_ERROR_H | ||
|
||
class NodeInterfaceError | ||
{ | ||
public: | ||
enum class errors | ||
{ | ||
TypeCheckingFailed = 0, | ||
IncorrectNodeId, | ||
IncorrectSymbolName | ||
}; | ||
|
||
explicit NodeInterfaceError(errors error): m_error{error} {} | ||
|
||
const char* what() | ||
{ | ||
static const char* names[] = {"TypeCheckingFailed", "IncorrectNodeId", "IncorrectSymbolName"}; | ||
|
||
return names[static_cast<int>(m_error)]; | ||
} | ||
|
||
private: | ||
errors m_error; | ||
}; | ||
|
||
class ExecutionInterfaceError | ||
{ | ||
public: | ||
enum class errors | ||
{ | ||
PythonInternalError = 0, | ||
InvalidArguments | ||
}; | ||
|
||
explicit ExecutionInterfaceError(errors error, NodeId id, std::optional<std::string> detail = std::nullopt): | ||
m_error{error}, | ||
m_id{id}, | ||
m_detail{std::move(detail)} | ||
{} | ||
|
||
std::string what() | ||
{ | ||
static const char* names[] = {"PythonInternalError", "InvalidArguments"}; | ||
std::string buffer = names[static_cast<int>(error())]; | ||
buffer += "("; | ||
buffer += std::to_string(id().get()); | ||
buffer += ")"; | ||
|
||
if(m_detail) | ||
{ | ||
buffer += ": "; | ||
buffer += m_detail.value(); | ||
} | ||
|
||
return buffer; | ||
} | ||
|
||
NodeId id() const { return m_id; } | ||
errors error() const { return m_error; } | ||
const std::optional<std::string>& detail() const { return m_detail; } | ||
|
||
private: | ||
errors m_error; | ||
NodeId m_id; | ||
std::optional<std::string> m_detail; | ||
}; | ||
|
||
#endif //GIE_ERROR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
#include <utility> | ||
|
||
#include <utility> | ||
|
||
// | ||
// Created by alex on 11/17/18. | ||
// | ||
|
||
#ifndef GIE_LIBRARY_NODE_H | ||
#define GIE_LIBRARY_NODE_H | ||
|
||
#include "NodeDrawable.h" | ||
#include "NodeLogic.h" | ||
#include "NodeMetadata.h" | ||
#include <gie/Argument.h> | ||
#include <gie/NodeId.h> | ||
#include <gie/PythonContext.h> | ||
|
||
#include <vector> | ||
#include <memory> | ||
#include <cstddef> | ||
|
||
using NodeId = std::size_t; | ||
|
||
struct Node | ||
class Node | ||
{ | ||
NodeDrawable m_drawable; | ||
NodeLogic m_logic; | ||
NodeMetadata m_metadata; | ||
private: | ||
Node(Arguments arguments, SymbolId symbolId): | ||
arguments{std::move(arguments)}, | ||
m_symbolId{symbolId} | ||
{} | ||
|
||
public: | ||
Arguments arguments; | ||
|
||
public: | ||
const SymbolId& symbolId() const { return m_symbolId; } | ||
|
||
private: | ||
SymbolId m_symbolId; | ||
|
||
friend std::optional<Node> makeNode(const PythonContext&, const std::string& name, Arguments); | ||
}; | ||
|
||
std::optional<Node> makeNode(const PythonContext&, const std::string& name, Arguments); | ||
|
||
#endif //GIE_LIBRARY_NODE_H |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Created by alex on 7/14/19. | ||
// | ||
|
||
#ifndef GIE_NODEID_H | ||
#define GIE_NODEID_H | ||
|
||
#include <StrongAlias.h> | ||
#include <functional> | ||
|
||
using NodeId = StrongAlias<std::size_t, struct NodeIdTag>; | ||
|
||
inline bool operator==(const NodeId& lhs, const NodeId& rhs) { return lhs.get() == rhs.get(); } | ||
|
||
namespace std | ||
{ | ||
template<> struct hash<NodeId> | ||
{ | ||
using argument_type = NodeId; | ||
using result_type = std::size_t; | ||
|
||
result_type operator()(const NodeId& id) const noexcept | ||
{ | ||
return (std::hash<std::size_t>{})(id.get()); | ||
} | ||
}; | ||
} | ||
|
||
#endif //GIE_NODEID_H |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.