Cleanup and support for relative paths
This commit is contained in:
1 parent
389113722e
commit
c17fbd2dcf
11 files changed
+339
-73
No files matched your search
@@ -1,11 +1,11 @@
|
||||
#ifndef DOMAIN_ATTRIBUTE_H
|
||||
#define DOMAIN_ATTRIBUTE_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "rule.h"
|
||||
#include "value.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace domain {
|
||||
|
||||
class Enumeration {
|
||||
|
||||
@@ -30,7 +30,7 @@ std::optional<std::vector<Value>> Connection::getSecondWires() {
|
||||
}
|
||||
|
||||
Attribute Connection::getAttribute(std::string name) {
|
||||
for(uint i=0; i<attributes.size(); i++) {
|
||||
for(unsigned int i=0; i<attributes.size(); i++) {
|
||||
if(attributes[i].getName() == name) {
|
||||
return attributes[i];
|
||||
}
|
||||
@@ -39,7 +39,7 @@ Attribute Connection::getAttribute(std::string name) {
|
||||
}
|
||||
|
||||
bool Connection::hasAttribute(std::string name) {
|
||||
for(uint i=0; i<attributes.size(); i++) {
|
||||
for(unsigned int i=0; i<attributes.size(); i++) {
|
||||
if(attributes[i].getName() == name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#define DOMAIN_FUNCTION_SIGNATURE_H
|
||||
|
||||
#include<functional>
|
||||
#include<vector>
|
||||
|
||||
#include "value.h"
|
||||
|
||||
namespace domain {
|
||||
|
||||
@@ -8,7 +8,7 @@ Condition::Condition(std::string function, std::vector<Value> params, bool negat
|
||||
|
||||
bool Condition::evaluate(RuleContext &context) {
|
||||
std::vector<Value> request;
|
||||
for(uint i=0; i<params.size(); i++) {
|
||||
for(unsigned int i=0; i<params.size(); i++) {
|
||||
if(params[i].isType(Value::ADDRESS_SPACE_REFERENCE)) {
|
||||
request.push_back(Value::fromAddressSpace(context.addressSpaces.at(params[i].asReference())));
|
||||
} else if(params[i].isType(Value::ATTRIBUTE_REFERENCE)) {
|
||||
@@ -50,7 +50,7 @@ Rule::Rule(std::vector<IfStatement> statements)
|
||||
{}
|
||||
|
||||
std::optional<Action> Rule::evaluate(RuleContext &context) {
|
||||
for(uint i=0; i<statements.size(); i++) {
|
||||
for(unsigned int i=0; i<statements.size(); i++) {
|
||||
auto response = statements[i].evaluate(context);
|
||||
if(response) {
|
||||
return response;
|
||||
|
||||
Reference in new issue
Block a user