1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

Remove more left-overs from Go node-type

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2023-06-30 10:55:48 +02:00
parent 4d43b72d78
commit cf5ef3927c
4 changed files with 0 additions and 180 deletions

View file

@ -1,28 +0,0 @@
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(GO_DOWNLOAD_ARCH "amd64")
set(GO_DOWNLOAD_HASH "980e65a863377e69fd9b67df9d8395fd8e93858e7a24c9f55803421e453f4f99")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(GO_DOWNLOAD_ARCH "arm64")
set(GO_DOWNLOAD_HASH "57a9171682e297df1a5bd287be056ed0280195ad079af90af16dcad4f64710cb")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(GO_DOWNLOAD_ARCH "armv6l")
set(GO_DOWNLOAD_HASH "3287ca2fe6819fa87af95182d5942bf4fa565aff8f145812c6c70c0466ce25ae")
endif()
FetchContent_Declare(
go
URL https://go.dev/dl/go1.17.8.linux-${GO_DOWNLOAD_ARCH}.tar.gz
URL_HASH SHA256=${GO_DOWNLOAD_HASH}
)
message(STATUS "Downloading Go toolchain for linux/${GO_DOWNLOAD_ARCH}")
FetchContent_MakeAvailable(go)
find_program(GO
NAMES go
NO_DEFAULT_PATH
PATHS
${CMAKE_CURRENT_BINARY_DIR}/_deps/go-src/bin
${go_SOURCE_DIR}
)

View file

@ -1,20 +0,0 @@
/** Node-type implemeted in Go language
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#pragma once
typedef void *_go_plugin;
typedef void *_go_plugin_list;
typedef void *_go_logger;
typedef void (*_go_register_node_factory_cb)(_go_plugin_list pl, char *name, char *desc, int flags);
typedef void (*_go_logger_log_cb)(_go_logger l, int level, char *msg);
_go_logger * _go_logger_get(char *name);
void _go_logger_log(_go_logger *l, int level, char *msg);

View file

@ -1,127 +0,0 @@
/** Node-type implemeted in Go language
*
* @file
* @author Steffen Vogel <post@steffenvogel.de>
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
* @license Apache 2.0
*********************************************************************************/
#pragma once
#include <villas/node.hpp>
namespace villas {
namespace node {
/* Forward declarations */
struct Sample;
class Format;
class GoNodeFactory;
class GoNode : public Node {
friend GoNodeFactory;
protected:
uintptr_t node; // runtime/cgo.Handle
std::string _details;
Format *formatter;
virtual
int _read(struct Sample * smps[], unsigned cnt);
virtual
int _write(struct Sample * smps[], unsigned cnt);
public:
GoNode(uintptr_t n);
virtual
~GoNode();
virtual
int parse(json_t *json);
virtual
std::vector<int> getPollFDs();
virtual
std::vector<int> getNetemFDs();
virtual
const std::string & getDetails();
virtual
int prepare();
virtual
int check();
virtual
int start();
virtual
int stop();
virtual
int pause();
virtual
int resume();
virtual
int restart();
virtual
int reverse();
};
class GoNodeFactory : public NodeFactory {
protected:
std::string name;
std::string description;
int flags;
public:
GoNodeFactory(char *n, char *d, int f = 0) :
NodeFactory(),
name(n),
description(d),
flags(f)
{ }
virtual
Node * make();
virtual
std::string getName() const
{
return name;
}
virtual
std::string getDescription() const
{
return description;
}
virtual
int getFlags() const
{
return flags;
}
};
class GoPluginRegistry : public plugin::SubRegistry {
public:
GoPluginRegistry();
plugin::List<> lookup();
};
} /* namespace node */
} /* namespace villas */

View file

@ -134,11 +134,6 @@ target_include_directories(villas PUBLIC ${INCLUDE_DIRS})
target_link_libraries(villas PUBLIC ${LIBRARIES})
target_link_libraries(villas PRIVATE -Wl,--whole-archive ${WHOLE_ARCHIVES} -Wl,--no-whole-archive)
# We need to link with -Bsymbolic in order to use link libvillas
# with Go code (Cgo)
# See also: https://stackoverflow.com/a/67299849
# target_link_options(villas PUBLIC "-Wl,-Bsymbolic")
set_target_properties(villas PROPERTIES
VERSION ${CMAKE_PROJECT_VERSION}
SOVERSION 1