本文整理汇总了C++中Transaction::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Transaction::clear方法的具体用法?C++ Transaction::clear怎么用?C++ Transaction::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
SocketIMEngineGlobal::init_transaction (Transaction &trans)
{
trans.clear ();
trans.put_command (SCIM_TRANS_CMD_REQUEST);
trans.put_data (m_socket_magic_key);
}
示例2:
bool prepare (int icid)
{
if (!m_socket.is_connected ()) return false;
int cmd;
uint32 data;
if (m_send_refcount <= 0) {
m_current_icid = icid;
m_send_trans.clear ();
m_send_trans.put_command (SCIM_TRANS_CMD_REQUEST);
m_send_trans.put_data (m_socket_magic_key);
m_send_trans.put_data ((uint32) icid);
m_send_trans.get_command (cmd);
m_send_trans.get_data (data);
m_send_trans.get_data (data);
m_send_refcount = 0;
}
if (m_current_icid == icid) {
m_send_refcount ++;
return true;
}
return false;
}
示例3: ecore_ise_input_handler
static Eina_Bool ecore_ise_input_handler (void *data, Ecore_Fd_Handler *fd_handler)
{
int cmd;
int timeout = 0;
Transaction trans;
if (fd_handler == NULL)
return ECORE_CALLBACK_RENEW;
int fd = ecore_main_fd_handler_fd_get (fd_handler);
if (_imcontrol_client.is_connected () &&
isf_socket_wait_for_data_internal (fd, timeout) > 0) {
trans.clear ();
if (!trans.read_from_socket (fd, timeout)) {
IMFCONTROLERR ("%s:: read_from_socket() may be timeout \n", __FUNCTION__);
_isf_imf_control_finalize ();
return ECORE_CALLBACK_CANCEL;
}
if (trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_REQUEST) {
while (trans.get_command (cmd)) {
ecore_ise_process_data (trans, cmd);
}
}
return ECORE_CALLBACK_RENEW;
}
IMFCONTROLERR ("ecore_ise_input_handler is failed!!!\n");
_isf_imf_control_finalize ();
return ECORE_CALLBACK_CANCEL;
}
示例4: get_helper_list
void get_helper_list (const Socket &client)
{
HelperRepository::iterator it = __helpers.begin ();
__send_trans.clear ();
__send_trans.put_command (SCIM_TRANS_CMD_REPLY);
__send_trans.put_data ((uint32)__helpers.size ());
for (; it != __helpers.end (); ++it) {
__send_trans.put_data (it->first.uuid);
__send_trans.put_data (it->first.name);
__send_trans.put_data (it->first.icon);
__send_trans.put_data (it->first.description);
__send_trans.put_data (it->first.option);
}
__send_trans.write_to_socket (client);
}