VLink  2.0.0
A high-performance communication middleware
vlink::SchemaPluginManager类 参考final

Singleton accessor that owns a lazily loaded SchemaPluginInterface plugin. 更多...

#include <schema_plugin_manager.h>

vlink::SchemaPluginManager 的协作图:

Public 成员函数

bool is_valid () const
 Reports whether a plugin was successfully loaded. 更多...
 
std::shared_ptr< SchemaPluginInterfaceget_interface () const
 Returns the shared plugin instance, or nullptr when the manager is invalid. 更多...
 

静态 Public 成员函数

static SchemaPluginManagerget (const std::string &schema_plugin_path="")
 Returns the process-wide manager, building it on the first call. 更多...
 

详细描述

Singleton accessor that owns a lazily loaded SchemaPluginInterface plugin.

Subsequent get() invocations are cheap and return the cached singleton regardless of the argument passed; the very first call wins. The destructor releases the contained interface before tearing down the Plugin loader, ensuring the shared object outlives any dependent global objects inside it.

成员函数说明

◆ get()

static SchemaPluginManager& vlink::SchemaPluginManager::get ( const std::string &  schema_plugin_path = "")
static

Returns the process-wide manager, building it on the first call.

参数
schema_plugin_pathAbsolute path to the plugin shared object. Empty means fall back to the VLINK_SCHEMA_PLUGIN environment variable.
返回
Reference to the singleton instance.

◆ get_interface()

std::shared_ptr<SchemaPluginInterface> vlink::SchemaPluginManager::get_interface ( ) const

Returns the shared plugin instance, or nullptr when the manager is invalid.

返回
Shared pointer to the loaded SchemaPluginInterface implementation.

◆ is_valid()

bool vlink::SchemaPluginManager::is_valid ( ) const

Reports whether a plugin was successfully loaded.

返回
true when get_interface() will yield a non-null pointer.

该类的文档由以下文件生成: