ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::np_actormodule_forward< T > Struct Template Reference

用标识符包装载荷,使模块级路由可以定位到一个逻辑子对象。 More...

#include <nprotocol_template.h>

Public Types

using BASE_TYPE = T
 载荷类型别名

Public Member Functions

 np_actormodule_forward (int64_t aidentifier, const std::shared_ptr< T > &adata)
 使用标识符和共享指针构造。
 np_actormodule_forward (int64_t aidentifier, const T &adata)
 使用标识符和数据值构造。
 np_actormodule_forward (int64_t aidentifier)
 使用标识符构造,默认初始化载荷。
 np_actormodule_forward ()
 默认构造函数。
T * data () const
 获取载荷数据指针。
int64_t identifier () const
 获取模块标识符。
void set_identifier (int64_t aidentifier)
 设置模块标识符。

Detailed Description

template<typename T>
struct ngl::np_actormodule_forward< T >

用标识符包装载荷,使模块级路由可以定位到一个逻辑子对象。

Actor模块转发结构体模板。

Template Parameters
T载荷数据类型。

用于Actor模块间的消息转发,支持类型化的消息传递。

Template Parameters
T转发的数据类型

Constructor & Destructor Documentation

◆ np_actormodule_forward() [1/3]

template<typename T>
ngl::np_actormodule_forward< T >::np_actormodule_forward ( int64_t aidentifier,
const std::shared_ptr< T > & adata )
inline

使用标识符和共享指针构造。

Parameters
aidentifier模块标识符。
adata载荷数据共享指针。

◆ np_actormodule_forward() [2/3]

template<typename T>
ngl::np_actormodule_forward< T >::np_actormodule_forward ( int64_t aidentifier,
const T & adata )
inline

使用标识符和数据值构造。

Parameters
aidentifier模块标识符。
adata载荷数据值。

◆ np_actormodule_forward() [3/3]

template<typename T>
ngl::np_actormodule_forward< T >::np_actormodule_forward ( int64_t aidentifier)
inlineexplicit

使用标识符构造,默认初始化载荷。

Parameters
aidentifier模块标识符。

Member Function Documentation

◆ data()

template<typename T>
T * ngl::np_actormodule_forward< T >::data ( ) const
inline

获取载荷数据指针。

Returns
载荷数据指针。

◆ identifier()

template<typename T>
int64_t ngl::np_actormodule_forward< T >::identifier ( ) const
inline

获取模块标识符。

Returns
模块标识符。

◆ set_identifier()

template<typename T>
void ngl::np_actormodule_forward< T >::set_identifier ( int64_t aidentifier)
inline

设置模块标识符。

Parameters
aidentifier新的模块标识符。

The documentation for this struct was generated from the following file: