| 977 | } |
| 978 | |
| 979 | GraphStruct* GraphModule::getOrCreateStruct(std::string name, bool* inserted) { |
| 980 | auto str = structFromName(name); |
| 981 | |
| 982 | if (str != nullptr) { |
| 983 | if (inserted != nullptr) { *inserted = false; } |
| 984 | return str; |
| 985 | } |
| 986 | // invalidate the cache |
| 987 | updateLastEditTime(); |
| 988 | |
| 989 | mStructs.push_back(std::make_unique<GraphStruct>(*this, std::move(name))); |
| 990 | |
| 991 | if (inserted != nullptr) { *inserted = true; } |
| 992 | return mStructs[mStructs.size() - 1].get(); |
| 993 | } |
| 994 | |
| 995 | bool GraphModule::removeStruct(boost::string_view name) { |
| 996 | // invalidate the cache |
no test coverage detected