| 65 | } |
| 66 | |
| 67 | long Service::CreateInterface(FancyRefPtr<MessageInterface>& rInterface, const char* name, uint16_t msgSize){ |
| 68 | if(strchr(name, '/')){ |
| 69 | Log::Warning("Service::CreateInterface: Invalid name \"%s\", cannot contain '/'"); |
| 70 | return -EINVAL; |
| 71 | } |
| 72 | |
| 73 | for(auto& i : interfaces){ |
| 74 | if(strcmp(name, i->name) == 0){ |
| 75 | return -EEXIST; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | rInterface = FancyRefPtr<MessageInterface>(new MessageInterface(name, msgSize)); |
| 80 | |
| 81 | interfaces.add_back(rInterface); |
| 82 | |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | long Service::ResolveInterface(FancyRefPtr<MessageInterface>& interface, const char* name){ |
| 87 | for(auto& _if : interfaces){ |
no test coverage detected