• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NUMELEMS函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: StringToSerialType

BasicSerializedDataType StringToSerialType(const char *type)
{
	if (!strcmp(type, "string") || !strcmp(type, "std::string"))
		return SerialString;
	assert(NumSerialTypes-2 == NUMELEMS(data));
	for(size_t i = 0; i < NUMELEMS(data); ++i)
		if (!strcmp(type, data[i]))
			return (BasicSerializedDataType)i;

	return SerialInvalid;
}
开发者ID:ElishaMcNutt,项目名称:Clockwork,代码行数:11,代码来源:MessageListParser.cpp


示例2: assert

const char *SerialTypeToReadableString(BasicSerializedDataType type)
{
	assert(NumSerialTypes-2 == NUMELEMS(data));
	assert(type >= SerialInvalid);
	assert(type < NumSerialTypes); 
	return data[type];
}
开发者ID:ElishaMcNutt,项目名称:Clockwork,代码行数:7,代码来源:MessageListParser.cpp


示例3: SerialTypeSize

size_t SerialTypeSize(BasicSerializedDataType type)
{
	assert(NumSerialTypes-2 == NUMELEMS(data));
	assert(type >= SerialInvalid);
	assert(type < NumSerialTypes); 
	return typeSizes[type];	
}
开发者ID:ElishaMcNutt,项目名称:Clockwork,代码行数:7,代码来源:MessageListParser.cpp


示例4: ixHssAccCodeletChanThreadMain

PRIVATE
IX_STATUS
ixHssAccCodeletChanThreadMain (
    void* arg,
    void** ptrRetObj)
{
    ClientInfo *pClientInfo = (ClientInfo *)arg;
    Message *pMessage;

    while (1)
    {
        (void) ixOsalSemaphoreWait (
            &pClientInfo->messageSem, IX_OSAL_WAIT_FOREVER);

        pMessage = &pClientInfo->messageQ[pClientInfo->qTail++];
        pClientInfo->qTail %= NUMELEMS(pClientInfo->messageQ);

        switch (pMessage->type)
        {
        case RxCallback:
            ixHssAccCodeletChanRxCallbackProcess (
                pClientInfo->hssPortId,
                pMessage->params.rxOffset,
                pMessage->params.txOffset,
                pMessage->params.numHssErrs);
            break;
        }
    } /* while (1) */

    return IX_SUCCESS;
}
开发者ID:janfj,项目名称:dd-wrt,代码行数:31,代码来源:IxHssAccCodeletChan.c


示例5: ixAtmUtilsMbufPoolFreeGet

void
ixAtmUtilsMbufPoolFreeGet (UINT32 bufSize, UINT32 *avail)
{
    IX_OSAL_MBUF_POOL *poolPtr = NULL;
    unsigned i,numPools;

    numPools = NUMELEMS (poolInfo);

    for (i = 0; i < numPools; i++)
    {
        if (poolInfo[i].bufSize >= bufSize)
	{
            poolPtr = poolInfo[i].poolPtr;
            break;
	}
    }

    if (poolPtr == NULL)
    {
        ixOsalLog (IX_OSAL_LOG_LVL_ERROR,IX_OSAL_LOG_DEV_STDERR,
	    "ixAtmUtilsMbufPoolFreeGet - Invalid bufSize specified\n", 0, 0, 0, 0, 0, 0);
	*avail = 0;
        return;
    }

    *avail = poolPtr->freeBufsInPool;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:27,代码来源:IxAtmUtilsBufMan.c


示例6: load_alldevs

void load_alldevs(void){
  char *devs[] = DEVICES_USED;
  int num = NUMELEMS(devs);
  int i;
  for(i=0; i< num;i++)
    load_dev(devs[i]);
  return;
}
开发者ID:amarnathmhn,项目名称:ngspice,代码行数:8,代码来源:dev.c


示例7:

    const char *VariableTypeToStr(NetVariableType type)
    {
        const char *data[] = { "Invalid", "U8", "U16", "U32", "U64", "S8", "S16", "S32", "S64", "F32", "F64", "LLVector3", "LLVector3d",
            "LLVector4", "LLQuaternion", "UUID", "BOOL", "IPADDR", "IPPORT", "Fixed", "Variable", "BufferByte", "Buffer2Bytes", "Buffer4Bytes" };
        if (type < 0 || type >= NUMELEMS(data))
            return data[0];

        return data[type];
    }
开发者ID:A-K,项目名称:naali,代码行数:9,代码来源:NetMessageManager.cpp


示例8: NUMELEMS

    void NetMessageManager::DebugSendHardcodedTestPacket()
    {
        const uint8_t data[] =
        { 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00, 0x03, 0x37, 0x2d, 0x5e, 0x0d, 0xde, 0xc9, 0x50, 
          0xb7, 0x40, 0x2d, 0xa2, 0x23, 0xc1, 0xae, 0xe0, 0x7e, 0x35, 0xe6, 0x8e, 0x5b, 0x78, 0x42, 0xac, 0x6d, 
          0x11, 0x67, 0x47, 0xde, 0x91, 0xf3, 0x58, 0xa9, 0x65, 0x49, 0xb0, 0xf0 };

        connection->SendBytes(data, NUMELEMS(data));
    }
开发者ID:A-K,项目名称:naali,代码行数:9,代码来源:NetMessageManager.cpp


示例9: MultiByteToWideChar

void *AssetCache::OpenFileHandle(const QString &absolutePath)
{
    QString nativePath = QDir::toNativeSeparators(absolutePath);
    QByteArray fileBA = nativePath.toLocal8Bit();
    if (fileBA.size() < MAX_PATH)
    {
        WCHAR szFilePath[MAX_PATH];
        MultiByteToWideChar(CP_ACP, 0, fileBA.data(), -1, szFilePath, NUMELEMS(szFilePath));
        return CreateFile(szFilePath, GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    }
    else
    {
        // Prefixing file path with \\?\ is windows magic, see more from
        // http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
        // This allows use to open >MAX_PATH length file paths which do happen in asset cache if the 
        // source url is long! Assume 260*3 will be enough as it still very rarely goes over 260.
        fileBA = "\\\\?\\" + fileBA;
        WCHAR szFilePath[MAX_PATH*3];
        MultiByteToWideChar(CP_ACP, 0, fileBA.data(), -1, szFilePath, NUMELEMS(szFilePath));
        return CreateFileW(szFilePath, GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    }
}
开发者ID:360degrees-fi,项目名称:tundra,代码行数:22,代码来源:AssetCache.cpp


示例10: IsAssimpFileType

bool OgreMeshAsset::IsAssimpFileType() const
{
    const char * const openAssImpFileTypes[] = { ".3d", ".b3d", ".blend", ".dae", ".bvh", ".3ds", ".ase", ".obj", ".ply", ".dxf",
        ".nff", ".smd", ".vta", ".mdl", ".md2", ".md3", ".mdc", ".md5mesh", ".x", ".q3o", ".q3s", ".raw", ".ac",
        ".stl", ".irrmesh", ".irr", ".off", ".ter", ".mdl", ".hmp", ".ms3d", ".lwo", ".lws", ".lxo", ".csm",
        ".ply", ".cob", ".scn" };

    for(size_t i = 0; i < NUMELEMS(openAssImpFileTypes); ++i)
        if (this->Name().endsWith(openAssImpFileTypes[i], Qt::CaseInsensitive))
            return true;

    return false;
}
开发者ID:360degrees-fi,项目名称:tundra,代码行数:13,代码来源:OgreMeshAsset.cpp


示例11: msg_spy_find_msg

static CWPSTRUCT* msg_spy_find_msg(UINT message) {
    UINT i;

    msg_spy_pump_msg_queue();

    if (msg_spy.i_msg >= NUMELEMS(msg_spy.msgs))
        fprintf(stdout, "%s:%d: msg_spy: message buffer overflow!\n",
                __FILE__, __LINE__);

    for (i = 0; i < msg_spy.i_msg; i++)
        if (msg_spy.msgs[i].message == message)
            return &msg_spy.msgs[i];

    return NULL;
}
开发者ID:bilboed,项目名称:wine,代码行数:15,代码来源:imm32.c


示例12: rtems_monitor_object_lookup

const rtems_monitor_object_info_t *
rtems_monitor_object_lookup(
    rtems_monitor_object_type_t type
)
{
    const rtems_monitor_object_info_t *p;
    for (p = &rtems_monitor_object_info[0];
         p < &rtems_monitor_object_info[NUMELEMS(rtems_monitor_object_info)];
         p++)
    {
        if (p->type == type)
            return p;
    }
    return 0;
}
开发者ID:atixing,项目名称:rtems,代码行数:15,代码来源:mon-object.c


示例13: call_wnd_proc_filter

static LRESULT CALLBACK call_wnd_proc_filter(int nCode, WPARAM wParam,
                                             LPARAM lParam)
{
    if (HC_ACTION == nCode) {
        CWPSTRUCT *cwp = (CWPSTRUCT*)lParam;

        if ((cwp->hwnd == msg_spy.hwnd) &&
            (msg_spy.i_msg < NUMELEMS(msg_spy.msgs)))
        {
            memcpy(&msg_spy.msgs[msg_spy.i_msg], cwp, sizeof(msg_spy.msgs[0]));
            msg_spy.i_msg++;
        }
    }

    return CallNextHookEx(msg_spy.call_wnd_proc_hook, nCode, wParam, lParam);
}
开发者ID:bilboed,项目名称:wine,代码行数:16,代码来源:imm32.c


示例14: afdict_find

/**
 * Find the affix table entry for given connector name.
 * If the connector name is not in the table, return NULL.
 */
Afdict_class * afdict_find(Dictionary afdict, const char * con, bool notify_err)
{
	const char ** ac;

	for (ac = afdict_classname;
	     ac < &afdict_classname[NUMELEMS(afdict_classname)]; ac++)
	{
		if (0 == strcmp(*ac, con))
			return &afdict->afdict_class[ac - afdict_classname];
	}
	if (notify_err) {
		prt_error("Warning: Unknown class name %s found near line %d of %s.\n"
                "\tThis class name will be ignored.",
                con, afdict->line_number, afdict->name);
	}
	return NULL;
}
开发者ID:agayardo,项目名称:link-grammar,代码行数:21,代码来源:dictionary.c


示例15: get_msg_filter

static LRESULT CALLBACK get_msg_filter(int nCode, WPARAM wParam, LPARAM lParam)
{
    if (HC_ACTION == nCode) {
        MSG *msg = (MSG*)lParam;

        if ((msg->hwnd == msg_spy.hwnd) &&
            (msg_spy.i_msg < NUMELEMS(msg_spy.msgs)))
        {
            msg_spy.msgs[msg_spy.i_msg].hwnd    = msg->hwnd;
            msg_spy.msgs[msg_spy.i_msg].message = msg->message;
            msg_spy.msgs[msg_spy.i_msg].wParam  = msg->wParam;
            msg_spy.msgs[msg_spy.i_msg].lParam  = msg->lParam;
            msg_spy.i_msg++;
        }
    }

    return CallNextHookEx(msg_spy.get_msg_hook, nCode, wParam, lParam);
}
开发者ID:bilboed,项目名称:wine,代码行数:18,代码来源:imm32.c


示例16: ixAtmUtilsMbufShow

void
ixAtmUtilsMbufShow (void)
{

    IX_OSAL_MBUF_POOL *poolPtr = NULL;
    unsigned i,numPools;

    numPools = NUMELEMS (poolInfo);

    for (i = 0; i < numPools; i++)
    {
        poolPtr = poolInfo[i].poolPtr;
        if (poolPtr != NULL)
 	{
            IX_OSAL_MBUF_POOL_SHOW (poolPtr);
	}
    }
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:18,代码来源:IxAtmUtilsBufMan.c


示例17: DumpDeviceObject

void DumpDeviceObject(const DIDEVICEOBJECTINSTANCEA * instance)
{
    int i;

    static REFGUID guidTypes[] =
    {   &GUID_Button, &GUID_XAxis, &GUID_YAxis, &GUID_ZAxis, &GUID_RxAxis,
        &GUID_RyAxis, &GUID_RzAxis, &GUID_Slider
    };
    static const char *guidStrings[] =
    { "Button", "X", "Y", "Z", "Rx", "Ry", "Rz", "Slider" };

    /* Print information about buttons and axes */
    if (gVerbose) {
        for (i = 0; i < NUMELEMS(guidTypes); i++)
            if (IsEqualGUID(&instance->guidType, guidTypes[i]))
                printf("%s (%s)\n", instance->tszName, guidStrings[i]);
    }
}
开发者ID:palmer-dabbelt,项目名称:wine-joysticks,代码行数:18,代码来源:main.c


示例18: msg_spy_find_next_msg

static imm_msgs* msg_spy_find_next_msg(UINT message, UINT *start) {
    UINT i;

    msg_spy_pump_msg_queue();

    if (msg_spy.i_msg >= NUMELEMS(msg_spy.msgs))
        fprintf(stdout, "%s:%d: msg_spy: message buffer overflow!\n",
                __FILE__, __LINE__);

    for (i = *start; i < msg_spy.i_msg; i++)
        if (msg_spy.msgs[i].msg.message == message)
        {
            *start = i+1;
            return &msg_spy.msgs[i];
        }

    return NULL;
}
开发者ID:krofna,项目名称:wine,代码行数:18,代码来源:imm32.c


示例19: ixAtmUtilsMbufPoolInit

IX_STATUS
ixAtmUtilsMbufPoolInit(void)
{
    int i, numPools;

    numPools = NUMELEMS (poolInfo);

      for (i = 0; i < numPools; i++)
	{
      poolInfo[i].poolPtr =IX_OSAL_MBUF_POOL_INIT (poolInfo[i].numBufs, poolInfo[i].bufSize, "ixAtmUtils pool");
      if(poolInfo[i].poolPtr == NULL)
	{
        ixOsalLog (IX_OSAL_LOG_LVL_ERROR,IX_OSAL_LOG_DEV_STDERR, "mbufPoolInit: Null poolPtr returned\n", 0, 0, 0, 0, 0, 0);	  
	}
      }
    
    return IX_SUCCESS;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:18,代码来源:IxAtmUtilsBufMan.c


示例20: free_anysplit

void free_anysplit(Dictionary afdict)
{
	size_t i;
	anysplit_params *as = afdict->anysplit;

	if (NULL == as) return;

	for (i = 0; i < NUMELEMS(as->scl); i++)
	{
		if (NULL == as->scl[i].sp) continue;
		free(as->scl[i].sp);
		free(as->scl[i].p_selected);
		free(as->scl[i].p_tried);
	}
	free_regexs(as->regpre);
	free_regexs(as->regmid);
	free_regexs(as->regsuf);
	free(as);
}
开发者ID:lagleki,项目名称:jorne,代码行数:19,代码来源:anysplit.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NUMELMS函数代码示例发布时间:2022-05-30
下一篇:
C++ NUM2ULONG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap