mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
use new cpp code-style in VILLAScommon
This commit is contained in:
parent
30830ebca3
commit
c7d59e6011
7 changed files with 19 additions and 13 deletions
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 3e062fdc0f311d9eb4bc541b7a292def71f87cb0
|
||||
Subproject commit b8778630eae7caf7af8ceef27f201639b095ead3
|
|
@ -74,7 +74,13 @@ int memory_mmap_init(int hugepages)
|
|||
if (getuid() == 0) {
|
||||
ret = kernel::setNrHugepages(hugepages);
|
||||
if (ret) {
|
||||
logger->warn("Failed to increase number of reserved hugepages");
|
||||
logger->warn("Failed to increase number of reserved hugepages. Falling back to standard mmap() allocator.");
|
||||
|
||||
if (isContainer()) {
|
||||
logger->warn("Please run the container in the privileged mode:");
|
||||
logger->warn(" $ docker run --privileged ...");
|
||||
}
|
||||
|
||||
memory_default = &memory_mmap;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <villas/node_list.hpp>
|
||||
#include <villas/path.h>
|
||||
#include <villas/utils.hpp>
|
||||
#include <villas/uuid.hpp>
|
||||
#include <villas/colors.hpp>
|
||||
#include <villas/mapping.h>
|
||||
#include <villas/timing.h>
|
||||
|
@ -181,7 +182,7 @@ int node_parse(struct vnode *n, json_t *json, const uuid_t sn_uuid)
|
|||
}
|
||||
else
|
||||
/* Generate UUID from hashed config including node name */
|
||||
uuid_generate_from_json(n->uuid, json, sn_uuid);
|
||||
uuid::generateFromJson(n->uuid, json, sn_uuid);
|
||||
|
||||
if (json_netem) {
|
||||
#ifdef WITH_NETEM
|
||||
|
|
|
@ -379,7 +379,7 @@ int signal_generator_read(struct vnode *n, struct sample * const smps[], unsigne
|
|||
break;
|
||||
|
||||
case signal_generator::SignalType::RANDOM:
|
||||
s->last[i] += box_muller(0, s->stddev[i]);
|
||||
s->last[i] += boxMuller(0, s->stddev[i]);
|
||||
t->data[i].f = s->last[i];
|
||||
break;
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <villas/node/config.h>
|
||||
#include <villas/utils.hpp>
|
||||
#include <villas/colors.hpp>
|
||||
#include <villas/uuid.hpp>
|
||||
#include <villas/timing.h>
|
||||
#include <villas/pool.h>
|
||||
#include <villas/queue.h>
|
||||
|
@ -50,7 +51,6 @@
|
|||
|
||||
using namespace villas;
|
||||
using namespace villas::node;
|
||||
using namespace villas::utils;
|
||||
|
||||
/** Main thread function per path:
|
||||
* read samples from source -> write samples to destinations
|
||||
|
@ -441,7 +441,7 @@ int path_parse(struct vpath *p, json_t *json, NodeList &nodes, const uuid_t sn_u
|
|||
}
|
||||
else
|
||||
/* Generate UUID from hashed config */
|
||||
uuid_generate_from_json(p->uuid, json, sn_uuid);
|
||||
uuid::generateFromJson(p->uuid, json, sn_uuid);
|
||||
|
||||
/* Input node(s) */
|
||||
ret = mapping_list_parse(&p->mappings, json_in);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <villas/path.h>
|
||||
#include <villas/path_source.h>
|
||||
#include <villas/path_destination.h>
|
||||
#include <villas/utils.hpp>
|
||||
#include <villas/uuid.hpp>
|
||||
#include <villas/list.h>
|
||||
#include <villas/hook_list.hpp>
|
||||
#include <villas/memory.h>
|
||||
|
@ -46,7 +46,6 @@
|
|||
|
||||
using namespace villas;
|
||||
using namespace villas::node;
|
||||
using namespace villas::utils;
|
||||
|
||||
typedef char uuid_string_t[37];
|
||||
|
||||
|
@ -78,7 +77,7 @@ SuperNode::SuperNode() :
|
|||
throw SystemError("Failed to determine hostname");
|
||||
|
||||
/* Default UUID is derived from hostname */
|
||||
uuid_generate_from_str(uuid, hname);
|
||||
uuid::generateFromString(uuid, hname);
|
||||
|
||||
#ifdef WITH_NETEM
|
||||
kernel::nl::init(); /* Fill link cache */
|
||||
|
|
|
@ -36,13 +36,13 @@
|
|||
#include <villas/memory.h>
|
||||
#include <villas/tool.hpp>
|
||||
#include <villas/log.hpp>
|
||||
#include <villas/utils.hpp>
|
||||
#include <villas/uuid.hpp>
|
||||
|
||||
#include "villas-relay.hpp"
|
||||
|
||||
typedef char uuid_string_t[37];
|
||||
|
||||
using namespace villas::utils;
|
||||
using namespace villas;
|
||||
|
||||
namespace villas {
|
||||
namespace node {
|
||||
|
@ -61,7 +61,7 @@ RelaySession::RelaySession(Relay *r, Identifier sid) :
|
|||
|
||||
created = time(nullptr);
|
||||
|
||||
uuid_generate_from_str(uuid, identifier, r->uuid);
|
||||
uuid::generateFromString(uuid, identifier, r->uuid);
|
||||
}
|
||||
|
||||
RelaySession::~RelaySession()
|
||||
|
@ -236,7 +236,7 @@ Relay::Relay(int argc, char *argv[]) :
|
|||
hostname = hname;
|
||||
|
||||
/* Default UUID is derived from hostname */
|
||||
uuid_generate_from_str(uuid, hname);
|
||||
uuid::generateFromString(uuid, hname);
|
||||
|
||||
ret = memory_init(0);
|
||||
if (ret)
|
||||
|
|
Loading…
Add table
Reference in a new issue