ANNA Suite
2020b
Multipurpose development suite for Telco applications
|
#include <EngineManager.hpp>
Public Member Functions | |
virtual | ~EngineManager () |
appid_codec_engines_it | begin () const |
appid_codec_engines_it | end () const |
int | size () const |
void | registerCodecEngine (const ApplicationId &appid, Engine *engine) |
Engine * | getCodecEngine (const ApplicationId &appid) const |
Engine * | getMonoStackCodecEngine () const |
void | selectFromApplicationId (bool enable) |
bool | selectFromApplicationId (void) |
virtual anna::xml::Node * | asXML (anna::xml::Node *parent) const |
Friends | |
class | anna::Singleton< EngineManager > |
Additional Inherited Members | |
Static Public Member Functions inherited from anna::Singleton< T > | |
static T & | instantiate () |
static void | release () |
Helper class to centralize application codec engines and ease the automatic codec engine selection from codec resources (mainly Message class, but also Avp).
This is useful if you enable the auto selection from messages application id, avoiding to pre-initialize such codec messages with a specific engine before interpreting the data sources or building. At multithread application, it is recommended to specialize the message codec for each stack without using this engine manager.
|
virtual |
Class XML representation.
parent | XML node over which we will put instance information. |
|
inline |
|
inline |
Engine* anna::diameter::codec::EngineManager::getCodecEngine | ( | const ApplicationId & | appid | ) | const |
Get the associated codec engine for a provided Application-Id.
appid | Application-Id |
|
inline |
If only one codec engine is registered (mono-stack application), it will be returned (NULL in other case). This is because mono-stack applications could merge compatible stacks into one unique dictionary, using a global value for stack id with no relation regarding application-id concept.
void anna::diameter::codec::EngineManager::registerCodecEngine | ( | const ApplicationId & | appid, |
Engine * | engine | ||
) |
Registers a new codec engine (externally allocated) associated to an application id. If the application id exists, the new engine pointer will replace the existing one.
appid | Application-Id |
engine | Associated codec engine |
|
inline |
The user could select the appropriate codec engine depending on the context, but some applications could consider interesting automatic codec engine selection from managed messages (decoded from any source, or built from scratch). Then, this engine manager will be used registering all the supported stacks with their corresponding codec engines, and automatic selection will be done during decoding of any supported source of data (hexadecimal buffers, xml documents) or build operations.
If the user pre-initializes the codec engine for a #Message or #Avp element, this selection is ignored even if enabled: the codec engine only can be established one time, for security reasons.
enable | Activates/deactivates the codec engine selection from the Application-Id value. True by default and applicable when this manager store is not empty. |
|
inline |
|
inline |
|
friend |