| 90 | } |
| 91 | |
| 92 | void cDataMemory::registerWriteRequest(const char *lvl, const char *componentInstName) |
| 93 | { |
| 94 | if (lvl == NULL) return; |
| 95 | |
| 96 | // check if the same component attempts to register twice (which is ok), or if two components want to write to the same level!! |
| 97 | for (const auto &rq : wrq) { |
| 98 | if (!strcmp(lvl,rq.levelName)) { |
| 99 | if (!strcmp(rq.instanceName,componentInstName)) { |
| 100 | return; // ignore duplicate request from the same component |
| 101 | } else { |
| 102 | // it's likely another component wanting to write to the same level... |
| 103 | COMP_ERR("two components cannot write to the same level: '%s', component1='%s', component2='%s'",lvl,rq.instanceName,componentInstName); |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | // add request to list |
| 109 | wrq.emplace_back(componentInstName, lvl); |
| 110 | |
| 111 | SMILE_DBG(2,"registerWriteRequest: registered write request for level '%s' by component instance '%s'",lvl,componentInstName); |
| 112 | } |
| 113 | |
| 114 | /* add a new level with given _lcfg parameters */ |
| 115 | int cDataMemory::addLevel(sDmLevelConfig *_lcfg, const char *_name) |