| 111 | } |
| 112 | |
| 113 | void HdComment::AddConstant(MdString constant, std::string expression) { |
| 114 | |
| 115 | if (constant.Text().empty()) { |
| 116 | MDF_ERROR() << "An empty constant are not allowed"; |
| 117 | return; |
| 118 | } |
| 119 | if (const auto itr = constant_list_.find(constant); |
| 120 | itr != constant_list_.cend() ) { |
| 121 | MDF_ERROR() |
| 122 | << "A duplicate constant have been found. Constant/Expression: " |
| 123 | << constant.Text() << "/" << expression; |
| 124 | return; |
| 125 | } |
| 126 | constant_list_.emplace(std::move(constant), std::move(expression)); |
| 127 | } |
| 128 | |
| 129 | const MdConstantList& HdComment::Constants() const { |
| 130 | return constant_list_; |