当前位置: 首页>>代码示例>>C++>>正文


C++ MLog函数代码示例

本文整理汇总了C++中MLog函数的典型用法代码示例。如果您正苦于以下问题:C++ MLog函数的具体用法?C++ MLog怎么用?C++ MLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了MLog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loadObjectTree

static bool loadObjectTree(LoaderState& State, const XMLObject& xmlObject, XMLObjectVector &ret)
{
	XMLActor actor;

	auto found = TryForEachPath(State.Paths, xmlObject.SceneXMLFile, [&](auto& Path) {
		return XMLParser::parseScene(Path.c_str(), actor, ret);
	});
	if (!found)
	{
		MLog("loadObjectTree -- Failed to load xmlObject %s\n", xmlObject.Name.c_str());
		return false;
	}

	if (!actor.isValid)
		return false;

	if (!load(State, actor.eluName.c_str()))
	{
		MLog("loadObjectTree(%s) -- Failed to load object\n", xmlObject.Name.c_str());
		return false;
	}

	auto& Obj = State.Objects.back();
	Obj.World = MakeSaneWorldMatrix(xmlObject.Position, xmlObject.Dir, xmlObject.Up);

	return true;
}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:27,代码来源:EluLoader.cpp

示例2: Init

bool LightmapGenerator::Generate()
{	
	Init();

	for (size_t i = 0; i < bsp.ConvexPolygons.size(); i++)
	{
		// The progress function returning false
		// indicates that the generation needs to stop.
		if (pProgressFn && !pProgressFn((float)i / (float)bsp.ConvexPolygons.size()))
			return false;

		int lightmapsize{};
		if (!ProcessConvexPolygon(&bsp.ConvexPolygons[i], i, lightmapsize))
		{
			MLog("LightmapGenerator::Generate -- ProcessConvexPolygon failed for polygon index %d\n", i);
			return false;
		}
		InsertLightmap(lightmapsize, i);
	}

	if (!SaveToFile())
	{
		MLog("LightmapGenerator::Generate -- SaveToFile failed\n");
		return false;
	}

	return true;
}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:28,代码来源:LightmapGenerator.cpp

示例3: MUGIDFromName

int MUGIDFromName(

  char *GName)

  {
  struct group *buf;
  int tmpGID = 0;

  const char *FName = "MUGIDFromName";

  MDB(7,fSTRUCT) MLog("%s(%s)\n",
    FName,
    (GName != NULL) ? GName : "NULL");

  if ((GName == NULL) || !strcmp(GName,NONE))
    {
    return(-1);
    }

  errno = 0;

  buf = getgrnam(GName);

  if (buf == NULL)
    {
    MDB(3,fSTRUCT) MLog("ALERT:    error looking up group '%s' - %s (errno:%d)\n",
      GName,
      strerror(errno),
      errno);
    
    /* look for GID??? format */

    if (!strncmp(GName,"GID",strlen("GID")))
      {
      return(atoi(GName + strlen("GID")));
      }

    /* check to see if GName is the GID number itself (group names cannot start
     * with a number) */

    tmpGID = (int)strtol(GName,NULL,10);

    if (tmpGID != 0)
      {
      return(tmpGID);
      }

    return(-1);
    }

  return(buf->gr_gid);
  }    /* END MUGIDFromName() */
开发者ID:dhh1128,项目名称:cbase,代码行数:52,代码来源:MUsersGroups.c

示例4: gh_getZipPackURL

NFAPI SCCString gh_getZipPackURL(SCCString url)
{
    // https://github.com/qokelate/CCGame
    // https://github.com/qokelate/CCGame.git
    // https://codeload.github.com/liftoff/GateOne/zip/master

    if (false == stringHasSubString(url, ".github.com/")
            && false == stringHasSubString(url, "://github.com/")) return nullptr;

    if (stringHasSuffix(url, "/zip/master"))
    {
        auto ptr = copyAsSCString(url);

        MLog("url: ", ptr);

        return ptr;
    }

    auto len = SCStringLen(url);

    auto ptr = (SCString)SCAlloc(len + 100);
    strcpy(ptr, "https://codeload.github.com");

    regexMatchFirst((void *)url, len, "://[^/]+/", nullptr, [&](SCRegexErrorInfo *errorInfo, size_t index, byte *buffer, size_t dataSize, void *param) {
        if (errorInfo)
        {
            MLog("error: ", errorInfo->errorMessage);
            return false;
        }

        auto pp = (SCCString)buffer + dataSize - 1;
        strcat(ptr, pp);

        return true;
    });

    len = SCStringLen(ptr);
    {
        auto pp = ptr + len - 4;
        if (stringCompare(pp, ".git")) *pp = 0;
    }

    strcat(ptr, "/zip/master");

    MLog("url: ", ptr);

    return ptr;
}
开发者ID:qokelate,项目名称:sma11caseX,代码行数:48,代码来源:GithubHelper.cpp

示例5: MCacheReadRsvs

int MCacheReadRsvs(

  marray_t *RArray,
  marray_t *ConstraintList)

  {
  mhashiter_t HTIter;
  char *Name;
  mtransrsv_t *R;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->RsvLock);

  while (MUHTIterate(&MCache->Rsvs,&Name,(void **)&R,NULL,&HTIter) == SUCCESS)
    {
    if (MRsvTransitionMatchesConstraints(R,ConstraintList))
      {
      MUArrayListAppendPtr(RArray,R);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     Reservation %s does not meet constraints.\n",R->Name);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->RsvLock);

  return(SUCCESS);
  }  /* END MCacheReadRsvs() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c

示例6: MCacheReadJobs

int MCacheReadJobs(

  marray_t *JArray,
  marray_t *ConstraintList)

  {
  mhashiter_t HTIter;
  char *Name;
  mtransjob_t *J;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->JobLock);

  while (MUHTIterate(&MCache->Jobs,&Name,(void **)&J,NULL,&HTIter) == SUCCESS)
    {
    if (MJobTransitionMatchesConstraints(J,ConstraintList))
      {
      MUArrayListAppendPtr(JArray,J);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     Job %s does not meet constraints.\n",J->Name);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->JobLock);

  return(SUCCESS);
  }  /* END MCacheReadJobs() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c

示例7: MCacheRemoveVM

int MCacheRemoveVM(

    char *Name)

  {
  if (MCache == NULL)
    {
    return(FAILURE);
    }

  if (MUStrIsEmpty(Name))
    {
    MDB(3,fSCHED) MLog("INFO:     Blank name given. Cannot remove from cache.\n");

    return(FAILURE);
    }

  pthread_rwlock_wrlock(&MCache->VMLock);

  MUHTRemove(&MCache->VMs,Name,&MVMTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MMongoDeleteO(Name,mxoxVM);
    }


  pthread_rwlock_unlock(&MCache->VMLock);

  return(SUCCESS);
  }
开发者ID:dhh1128,项目名称:cbase,代码行数:31,代码来源:MCache.c

示例8: MCacheWriteVM

int MCacheWriteVM(

  mtransvm_t *VM) /* I */

  {
  int rc;

  const char *FName = "MCacheWriteVM";

  MDB(8,fSCHED) MLog("%s(%s)\n",
    FName,
    (VM != NULL) ? VM->VMID : NULL);

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  pthread_rwlock_wrlock(&MCache->VMLock);

  rc = MUHTAdd(&MCache->VMs,VM->VMID,(void *)VM,NULL,&MVMTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MTransOToMongo(VM,mxoxVM);
    }

  pthread_rwlock_unlock(&MCache->VMLock);

  return(rc);
  }  /* END MCacheWriteVM() */
开发者ID:dhh1128,项目名称:cbase,代码行数:31,代码来源:MCache.c

示例9: MCacheRemoveJob

int MCacheRemoveJob(

    char *JName)

  {
  if (MUStrIsEmpty(JName))
    {
    MDB(3,fSCHED) MLog("INFO:     Blank name given. Cannot remove from cache.\n");

    return(FAILURE);
    }

  pthread_rwlock_wrlock(&MCache->JobLock);

  MUHTRemove(&MCache->Jobs,JName,&MJobTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MMongoDeleteO(JName,mxoJob);
    }

  pthread_rwlock_unlock(&MCache->JobLock);

  return(SUCCESS);
  }
开发者ID:dhh1128,项目名称:cbase,代码行数:25,代码来源:MCache.c

示例10: MCacheWriteNode

int MCacheWriteNode(

  mtransnode_t    *N)

  {
  int rc;

  const char *FName = "MCacheWriteNode";

  MDB(7,fTRANS) MLog("%s(%s)\n",
    FName,
    (MUStrIsEmpty(N->Name)) ? "NULL" : N->Name);

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  /* Obtain the write lock and write the object */

  pthread_rwlock_wrlock(&MCache->NodeLock);
  rc = MUHTAdd(&MCache->Nodes,N->Name,(void*)N,NULL,&MNodeTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MTransOToMongo(N,mxoNode);
    }

  pthread_rwlock_unlock(&MCache->NodeLock);

  return(rc);
  }  /* END MCacheWriteNode() */
开发者ID:dhh1128,项目名称:cbase,代码行数:32,代码来源:MCache.c

示例11: MCacheReadVMs

int MCacheReadVMs(

  marray_t *VMArray,        /* O */
  marray_t *ConstraintList) /* I */

  {
  mhashiter_t HTIter;
  char *VMID;
  mtransvm_t *VM;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->VMLock);

  while (MUHTIterate(&MCache->VMs,&VMID,(void **)&VM,NULL,&HTIter) == SUCCESS)
    {
    if (MVMTransitionMatchesConstraints(VM,ConstraintList))
      {
      MUArrayListAppendPtr(VMArray,VM);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     VM %s does not meet constraints.\n",VM->VMID);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->VMLock);

  return(SUCCESS);
  }  /* END MCacheReadVMs() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c

示例12: MSysDequeueSocket

int MSysDequeueSocket(
  
  msocket_t **S)  /* O */

  {
  if (S == NULL)
    {
    return(FAILURE);
    }

  if (MUDLListSize(MSocketQueue) == 0)
    {
    /* queue is empty */
    
    return(FAILURE);
    }

  MUMutexLock(&MSocketQueueMutex);

  *S = (msocket_t *)MUDLListRemoveFirst(MSocketQueue);

  MSched.TransactionCount--;

  MUMutexUnlock(&MSocketQueueMutex);

  MUGetMS(NULL,(long *)&(*S)->ProcessTime);

  MDB(7,fSOCK) MLog("INFO:     socket %d being serviced after %lu milli-sec wait\n",
    (*S)->sd,
    (*S)->ProcessTime - (*S)->CreateTime);
   
  return(SUCCESS);    
  }  /* END MSysDequeueSocket() */
开发者ID:dhh1128,项目名称:cbase,代码行数:33,代码来源:MSysSocketQueue.c

示例13: MDAGDestroy

int MDAGDestroy(

  marray_t *DList)  /* I (modified) */

  {
  int index;
  mdepend_t **DArray;
  mdepend_t  *tmpD;

  const char *FName = "MDAGDestroy";

  MDB(9,fALL) MLog("%s(DList)\n",
    FName);

  if (DList == NULL)
    {
    return(FAILURE);
    }

  DArray = (mdepend_t **)DList->Array;

  for (index = 0;index < DList->NumItems;index++)
    {
    tmpD = DArray[index];

    MUFree(&tmpD->Value);
    MUFree(&tmpD->SValue);

    MUFree((char **)&DArray[index]);
    }

  MUArrayListFree(DList);

  return(SUCCESS);
  } /* END MDAGDestroy() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MDAG.c

示例14: MCacheReadTriggers

int MCacheReadTriggers(

  marray_t *TArray,         /* O */
  marray_t *ConstraintList) /* I */

  {
  mhashiter_t HTIter;
  char *TrigID;
  mtranstrig_t *T;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->TriggerLock);

  while (MUHTIterate(&MCache->Triggers,&TrigID,(void **)&T,NULL,&HTIter) == SUCCESS)
    {
    if (MTrigTransitionMatchesConstraints(T,ConstraintList))
      {
      MUArrayListAppendPtr(TArray,T);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     Trigger %s does not meet constraints.\n",T->TrigID);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->TriggerLock);

  return(SUCCESS);
  }  /* END MCacheReadTriggers() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c

示例15: MLocalCheckFairnessPolicy

int MLocalCheckFairnessPolicy(

  mjob_t *J,
  long    StartTime,
  char   *Message)

  {
  const char *FName = "MLocalCheckFairnessPolicy";

  MDB(6,fSCHED) MLog("%s(%s,%ld,Message)\n",
    FName,
    (J != NULL) ? J->Name : "NULL",
    (unsigned long)StartTime);

/*
  if (ContribJobLengthFairnessPolicy(J,StartTime,Message) == FAILURE)
    {
    return(FAILURE);
    }
*/

/*
  if (ContribASCBackgroundJobPolicy(J,StartTime,Message) == FAILURE)
    {
    return(FAILURE);
    }
*/

  /* all local policies passed */

  return(SUCCESS);
  }  /* END MLocalFairnessPolicy() */
开发者ID:dhh1128,项目名称:cbase,代码行数:32,代码来源:MLocal.c


注:本文中的MLog函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。