#include <Engine.hpp>
◆ const_stack_iterator
◆ stack_container
◆ stack_iterator
◆ asString()
std::string anna::diameter::stack::Engine::asString |
( |
bool |
all = true | ) |
const |
Class string representation
- Parameters
-
all | Complete engine information versus only stacks list with its ids and dictionary names |
- Returns
- String with class content
◆ createDictionary()
Dictionary* anna::diameter::stack::Engine::createDictionary |
( |
unsigned int |
stackId, |
|
|
const std::string & |
xmlPathFile = "" |
|
) |
| |
|
noexcept |
Creates a diameter dictionary based on xml document file and store it over the provided stack identifier. If the stack is currently used, an exception will be launched to notify the stack collision (a dictionary could be removed with removeStack). If missing xml path file, the dictionary will be created without loading data.
Method 1 - Create and load xml data (commonly used for mono-load stacks):
engine->createDictionary(MMS_STACK_ID, "/var/tmp/mms.xml");
Method 2 - Create and then, load xml data (useful for multi-load stacks):
Dictionary * d = engine->createDictionary(MMS_STACK_ID);
// Loading data:
d->load("/var/tmp/mms.xml");
...
Method 3 - Create and then, load data through Dictionary API (*):
Dictionary * d = engine->createDictionary(MMS_STACK_ID);
// Loading data:
d->addFormat(...);
d->addVendor(...);
...
(*) Applications could create a dictionary with its own API (Dictionary) but it is much more difficult,
and usually, the method version with xml document load is used instead of this.
- Parameters
-
stackId | Stack identifier for created dictionary. We recommend to use the Diameter 'Application-Id' unless the application is going to use dictionaries covering different applications (which is not very usual). |
xmlPathFile | Path file to the xml document which represents the diameter dictionary. |
- Returns
- Dictionary registered. When exception happen, dictionary can be accessed by getDictionary
◆ getDictionary()
const Dictionary* anna::diameter::stack::Engine::getDictionary |
( |
unsigned int |
stackId | ) |
const |
Returns the dictionary registered with the provided identifier, which commonly is the 'Application-Id'.
- Parameters
-
- Returns
- Dictionary reference, NULL if no stack found
◆ isEmpty()
bool anna::diameter::stack::Engine::isEmpty |
( |
void |
| ) |
const |
|
inline |
Gets boolean about empty stack condition
- Returns
- Boolean about empty stack condition
74 {
return (!a_stacks.size()); }
◆ loadDictionary() [1/2]
void anna::diameter::stack::Engine::loadDictionary |
( |
const std::vector< unsigned int > & |
stacks, |
|
|
const std::string & |
xmlPathFile |
|
) |
| |
|
noexcept |
Loads an XML dictionary document over the diameter stack identifiers (one or more stack id's). Passing more than one stack id, synchronized loadings are performed, which could be useful when an application loads many dictionaries with common avps.
- Parameters
-
stacks | Stacks identifiers over which the dictionary will be load. |
xmlPathFile | Path file to the xml document which represents the diameter dictionary. |
◆ loadDictionary() [2/2]
void anna::diameter::stack::Engine::loadDictionary |
( |
const std::string & |
xmlPathFile | ) |
|
|
noexcept |
Loads an XML dictionary document over all the diameter engine registered stacks. When more than one stack id is used, synchronized loadings are performed, which could be useful when an application loads many dictionaries with common avps.
- Parameters
-
xmlPathFile | Path file to the xml document which represents the diameter dictionary. |
◆ registerDictionary()
Dictionary* anna::diameter::stack::Engine::registerDictionary |
( |
unsigned int |
stackId, |
|
|
Dictionary * |
dictionary |
|
) |
| |
|
noexcept |
Register a externally created Dictionary or a derived class from Dictionary
- Parameters
-
stackId | Stack identifier for provided dictionary. We recommend to use the Diameter 'Application-Id' unless the application is going to use dictionaries covering different applications (which is not very usual). |
dictionary | Externally created dictionary |
- Returns
- Dictionary registered. When exception happen, dictionary can be accessed by getDictionary
◆ removeStack()
void anna::diameter::stack::Engine::removeStack |
( |
unsigned int |
stackId | ) |
|
Remove the stack provided.
- Parameters
-
stackId | Stack identifier for created dictionary |
◆ removeStacks()
void anna::diameter::stack::Engine::removeStacks |
( |
void |
| ) |
|
|
inline |
Remove all stacks registered on diameter stack engine
155 { a_stacks.clear(); }
◆ stack_begin()
Beginning stack iterator
62 {
return a_stacks.begin(); }
◆ stack_end()
Ending stack iterator
64 {
return a_stacks.end(); }
◆ stack_size()
int anna::diameter::stack::Engine::stack_size |
( |
| ) |
const |
|
inline |
Stack size
66 {
return a_stacks.size(); }
◆ anna::Singleton< Engine >
◆ Dictionary
The documentation for this class was generated from the following file: