19 #include "hurricane/DbU.h"
20 #include "hurricane/Rule.h"
36 std::string _getTypeName ()
const;
37 std::string _getString ()
const;
38 Record* _getRecord ()
const;
68 typedef std::vector<RuleStep> Steps;
73 inline bool isDouble ()
const;
74 inline bool isDbU ()
const;
75 inline bool isSymmetric ()
const;
76 inline bool hasSteps ()
const;
77 inline void setSymmetric (
bool );
78 inline double getDoubleValue ()
const;
80 inline void addValue (
double );
87 virtual std::string _getTypeName ()
const;
88 virtual std::string _getString ()
const;
89 virtual Record* _getRecord ()
const;
91 inline void _addValue (
const RuleStep& );
99 inline PhysicalRule::PhysicalRule (
const Name& name
100 ,
const std::string& reference )
101 : Rule(name,reference)
108 inline PhysicalRule::PhysicalRule (
const PhysicalRule& rule )
109 : Rule(rule.getName(),rule.getReference())
110 , _stepsValue (rule._stepsValue)
111 , _doubleValue(rule._doubleValue)
126 if (_stepsValue.empty())
return 0;
127 for (
const RuleStep& step : _stepsValue ) {
128 if (length < step.getThreshold()) {
129 return (hDir) ? step.getHValue() : step.getVValue();
132 return (hDir) ? _stepsValue.back().getHValue() : _stepsValue.back().getVValue();;
138 RuleStep step ( value );
139 step.setThreshold( maxLength );
146 RuleStep step ( hValue, vValue );
147 step.setThreshold( maxLength );
152 inline void PhysicalRule::_addValue (
const RuleStep& step )
154 for (
auto istep = _stepsValue.begin() ; istep != _stepsValue.end() ; ++istep ) {
155 if (step.getThreshold() < (*istep).getThreshold()) {
156 _stepsValue.insert( istep, step );
160 _stepsValue.push_back( step );
168 INSPECTOR_PR_SUPPORT(Hurricane::RuleStep);
std::int64_t Unit
Definition: DbU.h:67
Name description (API)
Definition: Name.h:35
Define a rule for the technology (API).
Definition: PhysicalRule.h:65
bool isSymmetric() const
Definition: PhysicalRule.h:117
double getDoubleValue() const
Definition: PhysicalRule.h:119
bool hasSteps() const
Definition: PhysicalRule.h:118
DbU::Unit getValue(Hurricane::DbU::Unit length=0, bool hDir=true) const
Definition: PhysicalRule.h:124
bool isDouble() const
Definition: PhysicalRule.h:115
void addValue(double)
Definition: PhysicalRule.h:121
bool isDbU() const
Definition: PhysicalRule.h:116
void setSymmetric(bool)
Definition: PhysicalRule.h:120
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5