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

Refactor parameter name for parse() from cfg to json

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
This commit is contained in:
Steffen Vogel 2023-06-30 10:48:43 +02:00
parent e20bd664d9
commit d57a5d3306
5 changed files with 11 additions and 11 deletions

View file

@ -108,7 +108,7 @@ public:
virtual ~LuaHook();
virtual void parse(json_t *cfg);
virtual void parse(json_t *json);
virtual void prepare();

View file

@ -66,12 +66,12 @@ public:
/** Parse node connection details.
*
* @param cfg A JSON object containing the configuration of the node.
* @param json A JSON object containing the configuration of the node.
* @retval 0 Success. Everything went well.
* @retval <0 Error. Something went wrong.
*/
virtual
int parse(json_t *cfg, const uuid_t sn_uuid);
int parse(json_t *json, const uuid_t sn_uuid);
/** Returns a string with a textual represenation of this node. */
virtual

View file

@ -57,7 +57,7 @@ public:
~FpgaNode();
virtual
int parse(json_t *cfg, const uuid_t sn_uuid);
int parse(json_t *json, const uuid_t sn_uuid);
virtual
const std::string & getDetails();

View file

@ -89,14 +89,14 @@ int NodeCompat::prepare()
return Node::prepare();
}
int NodeCompat::parse(json_t *cfg, const uuid_t sn_uuid)
int NodeCompat::parse(json_t *json, const uuid_t sn_uuid)
{
int ret = Node::parse(cfg, sn_uuid);
int ret = Node::parse(json, sn_uuid);
if (ret)
return ret;
ret = _vt->parse
? _vt->parse(this, cfg)
? _vt->parse(this, json)
: 0;
if (!ret)
state = State::PARSED;

View file

@ -52,9 +52,9 @@ FpgaNode::FpgaNode(const std::string &name) :
FpgaNode::~FpgaNode()
{ }
int FpgaNode::parse(json_t *cfg, const uuid_t sn_uuid)
int FpgaNode::parse(json_t *json, const uuid_t sn_uuid)
{
int ret = Node::parse(cfg, sn_uuid);
int ret = Node::parse(json);
if (ret)
return ret;
@ -65,7 +65,7 @@ int FpgaNode::parse(json_t *cfg, const uuid_t sn_uuid)
const char *dma = nullptr;
int poll = polling;
ret = json_unpack_ex(cfg, &err, 0, "{ s?: s, s?: s, s?: s, s?: i, s?: b }",
ret = json_unpack_ex(json, &err, 0, "{ s?: s, s?: s, s?: s, s?: i, s?: b }",
"card", &card,
"interface", &intf,
"dma", &dma,
@ -73,7 +73,7 @@ int FpgaNode::parse(json_t *cfg, const uuid_t sn_uuid)
"polling", &polling
);
if (ret)
throw ConfigError(cfg, err, "node-config-fpga", "Failed to parse configuration of node {}", this->getName());
throw ConfigError(json, err, "node-config-fpga", "Failed to parse configuration of node {}", this->getName());
if (card)
cardName = card;