PandA-2024.02
design_flow.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2017-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
41 #include "design_flow.hpp"
42 #include "design_flow_manager.hpp" // for DesignFlowStepFactoryConstRef
43 #include "exceptions.hpp" // for THROW_UNREACHABLE
44 #include "string_manipulation.hpp" // for STR
45 
46 DesignFlow::DesignFlow(const DesignFlowManagerConstRef _design_flow_manager, const DesignFlow_Type _design_flow_type,
47  const ParameterConstRef _parameters)
48  : DesignFlowStep(_design_flow_manager, _parameters), design_flow_type(_design_flow_type)
49 {
50 }
51 
52 DesignFlow::~DesignFlow() = default;
53 
55 {
56 }
57 
58 std::string DesignFlow::GetSignature() const
59 {
61 }
62 
63 std::string DesignFlow::GetName() const
64 {
65  return "DF::" + EnumToKindText(design_flow_type);
66 }
67 
69 {
70  switch(design_flow_type)
71  {
73  return "NonDeterministicFlows";
74  default:
76  }
78  return "";
79 }
80 
81 DesignFlowStepFactoryConstRef DesignFlow::CGetDesignFlowStepFactory() const
82 {
83  return design_flow_manager.lock()->CGetDesignFlowStepFactory("DF");
84 }
85 
87 {
88  if(name == "NonDeterministicFlows")
89  {
91  }
92  else
93  {
94  THROW_UNREACHABLE("Unknown design flow: " + name);
96  }
97 }
98 
100 {
101  return true;
102 }
103 
105 {
106  return "DF::" + STR(static_cast<int>(design_flow_type));
107 }
DesignFlow(const DesignFlowManagerConstRef design_flow_manager, const DesignFlow_Type design_flow_type, const ParameterConstRef parameters)
Constructor.
Definition: design_flow.cpp:46
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
Definition: design_flow.cpp:99
RelationshipType
The relationship type.
static const std::string EnumToKindText(const DesignFlow_Type design_flow_type)
Return the name of the type.
Definition: design_flow.cpp:68
The base class for design step.
exceptions managed by PandA
DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory() const override
Return the factory to create this type of steps.
Definition: design_flow.cpp:81
static std::string ComputeSignature(const DesignFlow_Type design_flow_type)
Compute the signature of a step.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
const DesignFlow_Type design_flow_type
The type of this design flow.
Definition: design_flow.hpp:56
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
std::string GetName() const override
Return the name of this design step.
Definition: design_flow.cpp:63
Wrapper of design_flow.
std::string GetSignature() const override
Return the signature of this step.
Definition: design_flow.cpp:58
refcount< T > lock() const
Definition: refcount.hpp:212
DesignFlow_Type
Definition: design_flow.hpp:47
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
Definition: design_flow.cpp:54
This class contains the base representation for design flow.
static DesignFlow_Type KindTextToEnum(const std::string &name)
Given the name of design flow, return the enum.
Definition: design_flow.cpp:86
~DesignFlow() override
Destructor.

Generated on Mon Feb 12 2024 13:02:51 for PandA-2024.02 by doxygen 1.8.13