- anna::diameter::stack::Dictionary * d = stackEngine.createDictionary(
- 0 /* stack id */);
- // Analyze comma-separated list:
- anna::Tokenizer lst;
- lst.apply(dictionaries, ",");
-
- if(lst.size() >= 1) { // always true (at least one, because -dictionary is mandatory)
- anna::Tokenizer::const_iterator tok_min(lst.begin());
- anna::Tokenizer::const_iterator tok_max(lst.end());
- anna::Tokenizer::const_iterator tok_iter;
- std::string pathFile;
- d->allowUpdates();
-
- for(tok_iter = tok_min; tok_iter != tok_max; tok_iter++) {
- pathFile = anna::Tokenizer::data(tok_iter);
- d->load(pathFile);
+ anna::Tokenizer stacksTok;
+ stacksTok.apply(stacks, "#");
+ anna::Tokenizer::const_iterator stacks_it, stack_it;
+
+ for(stacks_it = stacksTok.begin(); stacks_it != stacksTok.end(); stacks_it++) {
+ std::string stack = anna::Tokenizer::data(stacks_it);
+ anna::Tokenizer stackTok;
+ stackTok.apply(stack, ",");
+
+ if(stackTok.size() == 1) {
+ if(stacksTok.size() != 1)
+ throw anna::RuntimeException("Application Id value is mandatory when more than one stack is going to be configured", ANNA_FILE_LOCATION);
+
+ anna::diameter::stack::Dictionary * d = stackEngine.createDictionary(0 /* no matter */, stack); // the stack is the dictionary
+ G_codecEngine->setDictionary(d);
+ break;