def write_enable_check(builder, tr): builder.line("bool Transition_{0.id}::is_enable(ca::ThreadBase *$thread, ca::NetBase *$net)", tr) builder.block_begin() builder.line("ca::Context ctx($thread, $net);") w = CppWriter() w.line("return true;") write_enable_pattern_match(builder, tr, w, "return false;") builder.line("return false;") builder.block_end()
def write_enable_check(builder, tr): builder.line( "bool Transition_{0.id}::is_enable(ca::ThreadBase *$thread, ca::NetBase *$net)", tr) builder.block_begin() builder.line("ca::Context ctx($thread, $net);") w = CppWriter() w.line("return true;") write_enable_pattern_match(builder, tr, w, "return false;") builder.line("return false;") builder.block_end()
def write_enable_check(builder, tr): builder.line("bool Transition_{0.id}::is_enable(ca::ThreadBase *$thread, ca::NetBase *$net)", tr) builder.block_begin() builder.line("ca::Context ctx($thread, $net);") w = CppWriter() for inscription in tr.get_token_inscriptions_in(): if inscription.is_conditioned(): w.if_begin("!$inscription_if_{0.uid}", inscription) w.line("delete $token_{0.uid};", inscription) w.block_end() w.line("return true;") write_enable_pattern_match(builder, tr, w, "return false;") builder.line("return false;") builder.block_end()
def write_enable_check(builder, tr): builder.line( "bool Transition_{0.id}::is_enable(ca::ThreadBase *$thread, ca::NetBase *$net)", tr) builder.block_begin() builder.line("ca::Context ctx($thread, $net);") w = CppWriter() for inscription in tr.get_token_inscriptions_in(): if inscription.is_conditioned(): w.if_begin("!$inscription_if_{0.uid}", inscription) w.line("delete $token_{0.uid};", inscription) w.block_end() w.line("return true;") write_enable_pattern_match(builder, tr, w, "return false;") builder.line("return false;") builder.block_end()