-
Cyril Moineau authoredCyril Moineau authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
NodeRegex.cpp 1.28 KiB
/********************************************************************************
* Copyright (c) 2023 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#include "aidge/graphmatching/NodeRegex.hpp"
// Verification done by the Parameter system
// Version 1 - Only test the type of the node (no need for a lexer)
// Input : Node_op
// Output : bool
// return mCondition == Node_op.type
bool Aidge::NodeRegex::_is(std::shared_ptr<Node> &Node_op){
std::string NodeType = Node_op->type();
return strcmp(NodeType.c_str(), mCondition.c_str()) == 0;
}
bool Aidge::NodeRegex::isA(std::string NodeType){
return strcmp(NodeType.c_str(), mCondition.c_str()) == 0;
}
// Version 2 - Test the node to an advanced condition
// Input : Node_op
// Output : bool
// return mCondition applied on Node
/**bool NodeRegex::_is(string &Node_op){
// Parsing the condition is done in the initialization of the NodeRegex
// assert parameters exist in the node with the parameter function isParam()
// get the parameters
}*/