基于topic,支持send/recv(一发一收),也支持pub/sub(一发多收) sub端每次订阅特定的topic之前都要先bindTopic生成一个唯一的conn_id_,实际上是绑定到这个conn_id_对应的GMessageObject的消息队列 recv是一发一收则可以直接用topic作为入参
More...
|
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | createTopic (const std::string &topic, CUInt size) |
| |
| CStatus | removeTopic (const std::string &topic) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | recvTopicValue (const std::string &topic, TImpl &value, CMSec timeout=CGRAPH_MAX_BLOCK_TTL) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | recvTopicValue (const std::string &topic, std::unique_ptr< TImpl > &value, CMSec timeout=CGRAPH_MAX_BLOCK_TTL) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | sendTopicValue (const std::string &topic, const TImpl &value, GMessagePushStrategy strategy) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | sendTopicValue (const std::string &topic, std::unique_ptr< TImpl > &value, GMessagePushStrategy strategy) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CIndex | bindTopic (const std::string &topic, CUInt size) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | pubTopicValue (const std::string &topic, const TImpl &value, GMessagePushStrategy strategy) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | subTopicValue (CIndex connId, TImpl &value, CMSec timeout=CGRAPH_MAX_BLOCK_TTL) |
| |
| template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0> |
| CStatus | subTopicValue (CIndex connId, std::unique_ptr< TImpl > &value, CMSec timeout=CGRAPH_MAX_BLOCK_TTL) |
| |
| CStatus | dropTopic (const std::string &topic) |
| |
| CStatus | clear () final |
| |
| CStatus | run () final |
| |
| | CObject ()=default |
| |
| virtual | ~CObject ()=default |
| |
template<typename T = GMessageParam, c_enable_if_t< std::is_base_of< GMessageParam, T >::value, int > = 0>
class GMessageManager< T, >
基于topic,支持send/recv(一发一收),也支持pub/sub(一发多收) sub端每次订阅特定的topic之前都要先bindTopic生成一个唯一的conn_id_,实际上是绑定到这个conn_id_对应的GMessageObject的消息队列 recv是一发一收则可以直接用topic作为入参
- Template Parameters
-
template<typename T = GMessageParam, c_enable_if_t< std::is_base_of< GMessageParam, T >::value, int > = 0>
template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0>
绑定对应的topic信息,并且获取 conn_id 信息
- Template Parameters
-
- Parameters
-
- Returns
template<typename T = GMessageParam, c_enable_if_t< std::is_base_of< GMessageParam, T >::value, int > = 0>
template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0>
创建 topic
- Template Parameters
-
- Parameters
-
- Returns
template<typename T = GMessageParam, c_enable_if_t< std::is_base_of< GMessageParam, T >::value, int > = 0>
template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0>
根据传入的topic,获得信息。仅针对传入智能指针的情况
- Template Parameters
-
- Parameters
-
- Returns
- @notice 这里的逻辑,跟上面的函数一致。里面调用了底层RingBuffer的同名不同入参的接口。 本人暂时没有能力完成接口的统一。如果有了解这一块内容的朋友,欢迎交流指正。
template<typename T = GMessageParam, c_enable_if_t< std::is_base_of< GMessageParam, T >::value, int > = 0>
template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0>
根据传入的 connId信息,来获取对应的message信息。仅针对传入智能指针的情况
- Template Parameters
-
- Parameters
-
- Returns
template<typename T = GMessageParam, c_enable_if_t< std::is_base_of< GMessageParam, T >::value, int > = 0>
template<typename TImpl , c_enable_if_t< std::is_base_of< T, TImpl >::value, int > = 0>
根据传入的 connId信息,来获取对应的message信息
- Template Parameters
-
- Parameters
-
- Returns