本文整理汇总了C++中LE函数的典型用法代码示例。如果您正苦于以下问题:C++ LE函数的具体用法?C++ LE怎么用?C++ LE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: BEGIN_IF
bool CCBuffer::isReadable(unsigned int u_len) const
{
BEGIN_IF(LH(LE(_u_content_size, 0), LE(u_len, 0)))
DO_RETURN_FLASE;
END_IF
DO_RETURN_R(LXE(CA(_u_read_pos, u_len), _u_content_size));
}
开发者ID:Ajention,项目名称:codestore,代码行数:7,代码来源:CCBuffer.cpp
示例2: GetTypeModuleSessionInfo
RTConnectionManager::ModuleInfo* RTConnectionManager::findConnectorInfoById(const std::string& userid)
{
RTConnectionManager::ModuleInfo* pInfo = NULL;
std::string connectorid;
std::string sessionid;
if (RTHiredisLocal::Instance()->CmdHGet(HI_USER_CONNECTOR_ID, userid, connectorid) && connectorid.length()>0) {
TypeModuleSessionInfoLists* infoList = GetTypeModuleSessionInfo();
TypeModuleSessionInfoLists::iterator it = infoList->begin();
TypeModuleSessionInfo* t_pInfo = NULL;
for (; it!=infoList->end(); it++) {
t_pInfo = *it;
if (t_pInfo && t_pInfo->moduleId.compare(connectorid) == 0) {
sessionid = t_pInfo->sessionIds.front();
LI("find transfer sessionid:%s", sessionid.c_str());
break;
}
}
} else {
LE("RTHiredis CmdHGet error\n");
}
if (sessionid.length()>0) {
pInfo = findModuleInfoBySid(sessionid);
} else {
LE("findConnectorInfoById sessionid is null\n");
}
return pInfo;
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:29,代码来源:RTConnectionManager.cpp
示例3: Assert
int MRTMeeting::Start(const char*pConnIp, unsigned short usConnPort, const char*pDispIp, unsigned short usDispPort, const char* pHttpIp, unsigned short usHttpPort)
{
Assert(g_inited);
Assert(pConnIp != NULL && strlen(pConnIp)>0);
Assert(pDispIp != NULL && strlen(pDispIp)>0);
Assert(pHttpIp != NULL && strlen(pHttpIp)>0);
char hh[24] = {0};
sprintf(hh, "%s:%u", pHttpIp, usHttpPort);
std::string mid;
GenericSessionId(mid);
MRTConnManager::Instance().SetMeetingId(mid);
LI("[][]MeetingId:%s\n", mid.c_str());
char addr[24] = {0};
sprintf(addr, "%s %u", pConnIp, usConnPort);
MRTConnManager::Instance().GetAddrsList()->push_front(addr);
if (!(MRTConnManager::Instance().ConnectConnector())) {
LE("Start to ConnectConnector failed\n");
return -1;
}
if (!(MRTRoomManager::Instance().Init(pDispIp, usDispPort, pHttpIp, usHttpPort, hh))) {
LE("Start to RoomManager Init failed\n");
return -1;
}
return 0;
}
开发者ID:changjiashuai,项目名称:Teameeting-MsgServer,代码行数:30,代码来源:MRTMeeting.cpp
示例4: fopen_tmpfile
FILE *fopentmpfile(PCStr(path),int remove)
{ FILE *fp;
int fd;
if( isWindowsCE() ){
fp = fopen_tmpfile(path);
add_FILEY(FL_ARG,"fopentmpfile",fp);
}else
if( ACT_UNLINKABLE ){
if( fp = fopen(path,FOPEN_RWB) )
if( remove )
unlink(path);
}else{
fd = newtmp(path);
if( 0 <= fd ){
if( fp = fdopen(fd,FOPEN_RWB) ){
addtmp(fd,path);
add_FILEY(FL_ARG,"fopentmpfile",fp);
LV("fopentmpfile(%s) %x/%d",path,p2i(fp),fileno(fp));
}else LE("cannot fdopen(%d) %s",fd,path);
}else{
LE("cannot open tmpfile(%s)",path);
fp = NULL;
}
}
return fp;
}
开发者ID:2dot4,项目名称:Psiphon3-for-Linux,代码行数:27,代码来源:windows0.c
示例5: decode
DLLEXPORT void decode(int link_type UNUSED,const char *packet,unsigned len)
{
unsigned int offset=0;
int value;
int more = 0;
LE(value,20); printf(" MPLS: Label: %d\n",value);
LE(value,3); printf(" MPLS: Class of service: %d\n",value);
LE(value,1); printf(" MPLS: Stack: %s\n",value?"Last" :"More");
if (value == 0) more = 1;
LE(value,8); printf(" MPLS: TTL: %d\n",value);
/* MPLS doesn't say what it's encapsulating, so we make an educated
* guess and pray.
*/
if (more)
decode_next(packet+offset/8,len-4,"eth",0x8847);
else if ((*(packet+4)&0xF0) == 0x40)
decode_next(packet+offset/8,len-4,"eth",0x0800);
else if ((*(packet+4)&0xF0) == 0x60)
decode_next(packet+offset/8,len-4,"eth",0x86DD);
else
decode_next(packet+offset/8,len-4,"link",1);
return;
}
开发者ID:EaseTheWorld,项目名称:libtrace,代码行数:25,代码来源:eth_34887.c
示例6: LE
//* For RTConnHttp
void CRTConnection::OnLogin(const char* pUserid, const char* pPass, const char* pNname)
{
bool ok = false;
{
//check & auth
#if 0
std::string pass;
RTHiredisRemote::Instance().CmdGet(pUserid, pass);
if (pass.compare(pPass)!=0) {
LE("OnLogin pass not same redis error\n");
return;
}
#endif
m_userId = pUserid;
m_token = pPass;
m_nname = pNname;
}
//if (ok) {
if (false) {
std::string sid;
//store userid & pass
CRTConnManager::ConnectionInfo* pci = new CRTConnManager::ConnectionInfo();
if (pci) {
GenericSessionId(sid);
m_connectorId = CRTConnManager::Instance().ConnectorId();
pci->_connId = sid;
pci->_connAddr = CRTConnManager::Instance().ConnectorIp();
pci->_connPort = CRTConnManager::Instance().ConnectorPort();
pci->_userId = pUserid;
pci->_token = pPass;
pci->_pConn = NULL;
pci->_connType = CONNECTIONTYPE::_chttp;
pci->_flag = 1;
std::string uid(pUserid);
CRTConnManager::Instance().AddUser(CONNECTIONTYPE::_chttp, uid, pci);
} else {
LE("new ConnectionInfo error!!!\n");
}
} else {
std::string uid(pUserid);
CRTConnManager::ConnectionInfo* pci = NULL;
CRTConnManager::Instance().AddUser(CONNECTIONTYPE::_chttp, uid, pci);
}
{
// send response
rapidjson::Document jsonDoc;
rapidjson::StringBuffer jsonStr;
rapidjson::Writer<rapidjson::StringBuffer> jsonWriter(jsonStr);
jsonDoc.SetObject();
if (ok) {
jsonDoc.AddMember("login", "success", jsonDoc.GetAllocator());
} else {
jsonDoc.AddMember("login", "failed", jsonDoc.GetAllocator());
}
jsonDoc.Accept(jsonWriter);
SendResponse(HPS_OK, jsonStr.GetString());
}
}
开发者ID:changjiashuai,项目名称:Teameeting-MsgServer,代码行数:59,代码来源:CRTConnection.cpp
示例7: b64_char_to_byte
/*
* Convert character c to the corresponding 6-bit value. If character c
* is not a Base64 character, then 0xFF (255) is returned.
*/
static unsigned b64_char_to_byte(int c) {
unsigned x;
x = (GE(c, 'A') & LE(c, 'Z') & (c - 'A')) |
(GE(c, 'a') & LE(c, 'z') & (c - ('a' - 26))) |
(GE(c, '0') & LE(c, '9') & (c - ('0' - 52))) | (EQ(c, '+') & 62) |
(EQ(c, '/') & 63);
return x | (EQ(x, 0) & (EQ(c, 'A') ^ 0xFF));
}
开发者ID:coolchenK,项目名称:libsodium,代码行数:13,代码来源:argon2-encoding.c
示例8: switch
bool RTHiredis::HandleReply(redisReply* reply, std::string* res)
{
switch (reply->type) {
case REDIS_REPLY_STRING:
{
if (res) {
res->assign(reply->str);
} else {
LI("reply str:%s\n", reply->str);
}
}
break;
case REDIS_REPLY_ARRAY:
{
LE("Is this Possible REPLY_ARRAY?\n");
}
break;
case REDIS_REPLY_INTEGER:
{
if (res) {
char c[12] = {0};
sprintf(c, "%lld", reply->integer);
res->assign(c);
} else {
LI("reply int:%lld\n", reply->integer);
}
}
break;
case REDIS_REPLY_NIL:
{
LI("reply nil\n");
}
break;
case REDIS_REPLY_STATUS:
{
LI("reply status\n");
}
break;
case REDIS_REPLY_ERROR:
{
if (res) {
res->assign(reply->str);
} else {
LI("reply err:%s\n", reply->str);
}
}
break;
default:
{
LE("reply default handle\n");
}
break;
}
return true;
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:55,代码来源:RTHiredis.cpp
示例9: LE
void MRTTransferSession::OnTypeConn(const std::string& str)
{
#if DEF_PROTO
pms::ConnMsg c_msg;
if (!c_msg.ParseFromString(str)) {
LE("OnTypeConn c_msg.ParseFromString error\n");
}
LI("OnTypeConn connmsg--->:\n");
//c_msg.PrintDebugString();
if ((c_msg.conn_tag() == pms::EConnTag::THELLO)) {
// when ME connector to other:
if (c_msg.transferid().length()>0) {
m_transferSessId = c_msg.transferid();
{
MRTConnManager::ModuleInfo* pmi = new MRTConnManager::ModuleInfo();
if (pmi) {
pmi->flag = 1;
pmi->othModuleType = c_msg.tr_module();
pmi->othModuleId = m_transferSessId;
pmi->pModule = this;
//bind session and transfer id
MRTConnManager::Instance().AddModuleInfo(pmi, m_transferSessId);
//store which moudle connect to this connector
MRTConnManager::Instance().AddTypeModuleSession(c_msg.tr_module(), c_msg.moduleid(), m_transferSessId);
LI("store other moduleid:%s, transfersessionid:%s\n", c_msg.moduleid().c_str(), m_transferSessId.c_str());
} else {
LE("new ModuleInfo error\n");
}
}
pms::TransferMsg t_msg;
c_msg.set_tr_module(pms::ETransferModule::MMEETING);
c_msg.set_conn_tag(pms::EConnTag::THELLOHI);
c_msg.set_transferid(m_transferSessId);
//send self module id to other
c_msg.set_moduleid(MRTConnManager::Instance().MeetingId());
t_msg.set_type(pms::ETransferType::TCONN);
t_msg.set_flag(pms::ETransferFlag::FNEEDACK);
t_msg.set_priority(pms::ETransferPriority::PHIGH);
t_msg.set_content(c_msg.SerializeAsString());
std::string s = t_msg.SerializeAsString();
SendTransferData(s.c_str(), (int)s.length());
} else {
LE("Connection id:%s error!!!\n", c_msg.transferid().c_str());
}
}
#else
LE("not define DEF_PROTO\n")
#endif
}
开发者ID:BoYuanZjq,项目名称:Teameeting-MsgServer,代码行数:54,代码来源:MRTTransferSession.cpp
示例10: Assert
int RTMsgQueue::Start(const char*pConnIp, unsigned short usConnPort, const char*pModuleIp, unsigned short usModulePort)
{
Assert(g_inited);
Assert(pConnIp != NULL && strlen(pConnIp)>0);
Assert(pModuleIp != NULL && strlen(pModuleIp)>0);
RTHiredisLocal::Instance()->Connect();
std::string mid;
RTConnectionManager::Instance()->GenericSessionId(mid);
RTConnectionManager::Instance()->SetMsgQueueId(mid);
LI("[][]MsgQueueId:%s\n", mid.c_str());
if(usConnPort == 0)
{
LE("MsgQueue server need usConnPort...!");
Assert(false);
}
if(usConnPort > 0)
{
char addr[24] = {0};
sprintf(addr, "%s %u", pConnIp, usConnPort);
RTConnectionManager::Instance()->GetAddrsList()->push_front(addr);
if (!(RTConnectionManager::Instance()->ConnectConnector())) {
LE("Start to ConnectConnector failed\n");
return -1;
}
}
if(usModulePort == 0)
{
LE("MsgQueue server need usModulePort...!!");
Assert(false);
}
if(usModulePort > 0)
{
m_pModuleListener = new RTModuleListener();
OS_Error err = m_pModuleListener->Initialize(INADDR_ANY, usModulePort);
if (err!=OS_NoErr)
{
LE("CreateMeetingListener error port=%d \n", usModulePort);
delete m_pModuleListener;
m_pModuleListener=NULL;
return -1;
}
LI("Start MsgQueue service meet:(%d) ok...,socketFD:%d\n", usModulePort, m_pModuleListener->GetSocketFD());
m_pModuleListener->RequestEvent(EV_RE);
}
return 0;
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:53,代码来源:RTMsgQueue.cpp
示例11: point_in_rectangle
bool point_in_rectangle(const point &p, const point &v, double w, double h) {
static const bool EDGE_IS_INSIDE = true;
if (w < 0) {
return point_in_rectangle(p, point(v.x + w, v.y), -w, h);
}
if (h < 0) {
return point_in_rectangle(p, point(v.x, v.y + h), w, -h);
}
return EDGE_IS_INSIDE
? (GE(p.x, v.x) && LE(p.x, v.x + w) && GE(p.y, v.y) && LE(p.y, v.y + h))
: (GT(p.x, v.x) && LT(p.x, v.x + w) && GT(p.y, v.y) && LT(p.y, v.y + h));
}
开发者ID:Alextrovert,项目名称:Algorithm-Anthology,代码行数:12,代码来源:5.1.5+Rectangle+(2D).cpp
示例12: LE
bool CRTTransferSession::Connect(const std::string addr, int port)
{
if (addr.empty() || port < 2048) {
LE("%s invalid params addr:%s, port:%d\n", __FUNCTION__, addr.c_str(), port);
return false;
}
OS_Error err = GetSocket()->Connect(SocketUtils::ConvertStringToAddr(addr.c_str()), port);
if (err == OS_NoErr || err == EISCONN) {
return true;
} else {
LE("%s ERR:%d\n", __FUNCTION__, err);
return false;
}
}
开发者ID:sn790519,项目名称:Teameeting-MsgServer,代码行数:14,代码来源:CRTTransferSession.cpp
示例13: LE
void RTConnectionTcp::OnSndMsg(MSGTYPE mType, long long mseq, const char* pUserid, const char* pData, int dLen)
{
if (!pData) {
LE("%s invalid params\n", __FUNCTION__);
std::string resp;
GenericResponse(SIGNALTYPE::reqsndmsg, mType, mseq, RTCommCode::_invparams, GetRTCommStatus(RTCommCode::_invparams), resp);
SendResponse(0, resp.c_str());
return;
}
//no matter mType is meet or callcenter or p2p or others
//the following code should be same
//find an TrasnferSession By mtype
//transfer msg by TransferSession
TRANSFERMSG t_trmsg;
TRANSMSG t_msg;
t_msg._flag = 0;
t_msg._touser = "";
t_msg._connector = RTConnectionManager::Instance()->ConnectorId();
t_msg._content = pData;
t_trmsg._action = TRANSFERACTION::req;
t_trmsg._fmodule = TRANSFERMODULE::mconnector;
t_trmsg._type = TRANSFERTYPE::trans;
t_trmsg._trans_seq = GenericTransSeq();
t_trmsg._trans_seq_ack = 0;
t_trmsg._valid = 1;
t_trmsg._content = t_msg.ToJson();
const std::string s = t_trmsg.ToJson();
RTConnectionManager::ModuleInfo* pmi = RTConnectionManager::Instance()->findModuleInfo(pUserid, (TRANSFERMODULE)mType);
if (pmi && pmi->pModule) {
pmi->pModule->SendTransferData(s.c_str(), (int)s.length());
} else {
LE("pmi->pModule is NULL\n");
std::string resp;
GenericResponse(SIGNALTYPE::reqsndmsg, mType, mseq, RTCommCode::_errmoduinfo, GetRTCommStatus(RTCommCode::_errmoduinfo), resp);
SendResponse(0, resp.c_str());
return;
}
{
std::string resp;
GenericResponse(SIGNALTYPE::reqsndmsg, mType, mseq, RTCommCode::_ok, GetRTCommStatus(RTCommCode::_ok), resp);
SendResponse(0, resp.c_str());
return;
}
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:48,代码来源:RTConnectionTcp.cpp
示例14: LE
const char* RTConnHttp::GenerateRequest(http_method method, const std::string& path, const std::string& data, int &outLen) const
{
if (path.length()==0) {
LE("params error!!!\n");
outLen = 0;
return "";
}
http_message *httpMsg = http_generator_create(HTTP_REQUEST);
http_generator_set_method(httpMsg, method);
http_generator_set_path(httpMsg, path.c_str(), (int)path.length());
http_generator_add_header(httpMsg, HPR_HOST, m_host.c_str(), (int)m_host.length());
http_generator_add_header(httpMsg, HPR_ACCEPT, "application/json", 16);
if(data.length()>0)
{
http_generator_set_content(httpMsg, data.c_str(), (int)data.length(), "application/x-www-form-urlencoded");
}
int nLen = 0;
char* pMsg = http_generator_tostring(httpMsg, &nLen);
outLen = nLen;
http_generator_destroy(httpMsg);
httpMsg = NULL;
return pMsg;
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:29,代码来源:RTConnHttp.cpp
示例15: while
int RTConnHttp::ProcessData(const char*pData, int nLen)
{
int parsed = 0;
enum http_errno err;
while (parsed < nLen)
{
const char* pMsg = pData + parsed;
int msgLen = nLen - parsed;
int nlen = do_http_parse(HTTP_RESPONSE, (char *)pMsg, msgLen, &err, &RTConnHttp::OnParsedHttpMessage, this);
parsed += nlen;
if (err != HPE_OK)
{
LE("do_http_parse error!!!!!!\n");
parsed = nLen;
break;
}
else if (nlen == 0)
{
break;
}
else
{
//LI(">Recv:%.*s \r\n", parsed, pMsg);
}
}
return parsed;
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:28,代码来源:RTConnHttp.cpp
示例16: LE
void RTHiredis::CmdPing()
{
if (!m_redisContext) {
return;
}
redisReply* m_redisReply = (redisReply*)redisCommand(m_redisContext, "PING");
if (!m_redisReply || m_redisReply->type == REDIS_REPLY_ERROR) {
LE("redis run error\n");
if (m_redisReply) {
LE("error::%s\n", m_redisReply->str);
}
return;
}
printf("CmdPing reply:%s\n", m_redisReply->str);
freeReplyObject((void*)m_redisReply);
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:16,代码来源:RTHiredis.cpp
示例17: LI
int RTTransfer::ProcessData(const char* pData, int nLen)
{
int parsed = 0;
int ll = 0;
LI("RTConnTcp::ProcessData pData:%s\n", pData);
while (parsed < nLen)
{
const char* pMsg = pData + parsed;
int offset = 0;
if (*(pMsg+offset) == '$') {
offset += 1;
char l[4] = {0};
memcpy(l, pMsg+offset, 4);
offset += 4;
ll = (int)strtol(l, NULL, 10);
if (ll>=0 && ll <= nLen) { // the message length may be 0
int nlen = DoProcessData((char *)(pMsg+offset), ll);
LI("Transfer DoProcessData msg nlen:%d, ll:%d\n", nlen, ll);
if (nlen < 0) {
break;
} else { // nlen < 0
assert(nlen == ll);
offset += ll;
parsed += offset;
}
} else { // ll>0 && ll <= nLen
LE("Get Msg Len Error!!!\n");
}
}
}
return parsed;
}
开发者ID:DyncEric,项目名称:Teameeting-MsgServer,代码行数:32,代码来源:RTTransfer.cpp
示例18: DeleteContent
/** Creates the buffers and sets up the rest od the object */
HRESULT EditorLinePrimitive::CreatePrimitive(LineVertex* PrimVerts, UINT NumVertices, D3D11_PRIMITIVE_TOPOLOGY Topology)
{
HRESULT hr=S_OK;
// Clean up previous data
DeleteContent();
// Copy over the new data
Vertices = new LineVertex[NumVertices];
memcpy(Vertices, PrimVerts, sizeof(LineVertex)*NumVertices);
this->NumVertices = NumVertices;
//Create the vertex buffer
D3D11_BUFFER_DESC bufferDesc;
bufferDesc.ByteWidth = NumVertices * sizeof(LineVertex);
bufferDesc.Usage = D3D11_USAGE_DEFAULT;
bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
bufferDesc.CPUAccessFlags = 0;
bufferDesc.MiscFlags = 0;
D3D11_SUBRESOURCE_DATA InitData;
InitData.pSysMem = &Vertices[0];
InitData.SysMemPitch = 0;
InitData.SysMemSlicePitch = 0;
D3D11GraphicsEngineBase* engine = (D3D11GraphicsEngineBase*)Engine::GraphicsEngine;
LE(engine->GetDevice()->CreateBuffer(&bufferDesc,&InitData,&PrimVB));
PrimitiveTopology = Topology;
return hr;
}
开发者ID:parav,项目名称:GD3D11,代码行数:34,代码来源:EditorLinePrimitive.cpp
示例19: join_trees
node* join_trees(node* n1, node* n2) {
node* lowest_n;
node* highest_n;
if (LE(n1->key, n2->key)) {
lowest_n = n1;
highest_n = n2;
} else {
lowest_n = n2;
highest_n = n1;
}
if (lowest_n->child == NULL) {
lowest_n->child = highest_n;
highest_n->parent = lowest_n;
} else {
concat_list(lowest_n->child, highest_n);
node* temp_ref = highest_n;
do {
temp_ref->parent = lowest_n;
temp_ref = temp_ref->right_sibling;
} while (temp_ref != highest_n);
}
lowest_n->rank = lowest_n->rank + 1;
highest_n->marked = 0;
return lowest_n;
}
开发者ID:kandersen,项目名称:dADS3,代码行数:28,代码来源:fibonacci_v1.cpp
示例20: LE
bool SymbolJudger::loadSymbols(const char *filename)
{
if (m_loaded) return 1;
m_loaded = 1;
if (trie == NULL)
{
LE("trie is NULL. Failed to load symbal");
return 0;
}
FILE *fp = fopen(filename, "r");
if (!fp)
{
LERR("open file %s failed!", filename);
return 0;
}
char s[LEN];
while (fgets(s, LEN, fp))
{
int len = strlen(s);
s[--len] = '\0';
bool ret = trie->insert(s, len, 1);
if (!ret) return 0;
}
return 1;
}
开发者ID:cainiaokeji,项目名称:IR,代码行数:25,代码来源:SymbolJudger.cpp
注:本文中的LE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论