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


C++ GetObj函数代码示例

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


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

示例1: ReadColors

static int ReadColors(CurPos &cp, const char *ObjName) {
    unsigned char obj;
    unsigned short len;

    while ((obj = GetObj(cp, len)) != 0xFF) {
        switch (obj) {
        case CF_STRING:
            {
                char cl[30];
                const char *sname = GetCharStr(cp, len);
                const char *svalue;
                if (sname == 0) return -1;
                if ((obj = GetObj(cp, len)) != CF_STRING) return -1;
                if ((svalue = GetCharStr(cp, len)) == 0) return -1;
                strcpy(cl, ObjName);
                strcat(cl, ".");
                strcat(cl, sname);
                if (SetColor(cl, svalue) == 0) return -1;
            }
            break;
        case CF_END:
            return 0;
        default:
            return -1;
        }
    }
    return -1;
}
开发者ID:OS2World,项目名称:APP-EDITOR-fte,代码行数:28,代码来源:c_config.cpp

示例2: GetCount

void CSpaceObjectList::Subtract (const CSpaceObjectList &List)

//	Subtract
//
//	Removes all objects in List from the current list

	{
	int i;

	//	Mark all current objects

	int iCount = GetCount();
	for (i = 0; i < iCount; i++)
		GetObj(i)->SetMarked(true);

	//	Clear marks on all objects to remove

	for (i = 0; i < List.GetCount(); i++)
		List.GetObj(i)->SetMarked(false);

	//	Create a new list with the remaining objects

	TArray<CSpaceObject *> NewList;
	for (i = 0; i < iCount; i++)
		if (GetObj(i)->IsMarked())
			NewList.Insert(GetObj(i));

	m_List.TakeHandoff(NewList);
	}
开发者ID:bmer,项目名称:Mammoth,代码行数:29,代码来源:CSpaceObjectList.cpp

示例3: ReadHilitColors

static int ReadHilitColors(CurPos &cp, EColorize *Colorize, const char * /*ObjName*/) {
    unsigned char obj;
    unsigned short len;

    while ((obj = GetObj(cp, len)) != 0xFF) {
        switch (obj) {
        case CF_INT:
            {
                long cidx;
                const char *svalue;

                if (GetNum(cp, cidx) == 0) return -1;
                if ((obj = GetObj(cp, len)) != CF_STRING)
                    return -1;
                if ((svalue = GetCharStr(cp, len)) == 0)
                    return -1;
                if (Colorize->SetColor(cidx, svalue) == 0)
                    return -1;
            }
            break;
        case CF_END:
            return 0;
        default:
            return -1;
        }
    }
    return -1;
}
开发者ID:OS2World,项目名称:APP-EDITOR-fte,代码行数:28,代码来源:c_config.cpp

示例4: CStageMng

void CGameManager::start()
{
	__super::start();

	fileMng_.Load();

	if (!GetObj(typeid(CStageMng)))
	{
		auto sm = std::shared_ptr<CStageMng>(new CStageMng());
		AddObject2(sm);
		TempCharacter t(sm);
		sm->load();
#ifdef DEF_GM_PTR
		//SetStageMngPtr(sm);
#endif
	}

	if (!GetObj(typeid(CScoreMng)))
	{
		auto sm = std::shared_ptr<CScoreMng>(new CScoreMng());
		AddObject2(sm);
#ifdef DEF_GM_PTR
		SetScoreMngPtr(sm);
#endif
	}

	if (!GetObj(typeid(CCollision)))
		AddObject2(ObjPtr(new CCollision()));

}
开发者ID:jg-maon,项目名称:Pendulum,代码行数:30,代码来源:gameManager.cpp

示例5: GetObj

void CGenerator::fill(int from , int to , int id = 1 )
{
	for(int z = from ; z < to ; z++)
		for(int i = 0 ; i < X ; i++)
			for(int j = 0 ; j < Y ; j++)
				if(GetObj(glm::ivec3(i,j,z)) != 1)
					GetObj(glm::ivec3(i,j,z)) = id;
}
开发者ID:Dreakii,项目名称:OpenWorld,代码行数:8,代码来源:CGenerator.cpp

示例6: ReadMenu

static int ReadMenu(CurPos &cp, const char *MenuName) {
    unsigned char obj;
    unsigned short len;

    int menu = -1, item = -1;

    menu = NewMenu(MenuName);

    while ((obj = GetObj(cp, len)) != 0xFF) {
        switch (obj) {
        case CF_ITEM:
            {
                if (len == 0) {
                    item = NewItem(menu, 0);
                } else {
                    const char *s = GetCharStr(cp, len);
                    int Cmd;
                    if (s == 0) return -1;
                    item = NewItem(menu, s);
                    if ((obj = GetObj(cp, len)) != CF_MENUSUB) return -1;
                    if ((Cmd = ReadCommands(cp, 0)) == -1) return -1;
                    Menus[menu].Items[item].Cmd = Cmd + 65536;
                }
            }
            break;
        case CF_SUBMENU:
            {
                const char *s = GetCharStr(cp, len);
                const char *w;

                if ((obj = GetObj(cp, len)) != CF_STRING) return -1;
                if ((w = GetCharStr(cp, len)) == 0) return -1;
                item = NewSubMenu(menu, s, GetMenuId(w), SUBMENU_NORMAL);
            }
            break;

        case CF_SUBMENUCOND:
            {
                const char *s = GetCharStr(cp, len);
                const char *w;

                if ((obj = GetObj(cp, len)) != CF_STRING) return -1;
                if ((w = GetCharStr(cp, len)) == 0) return -1;
                item = NewSubMenu(menu, s, GetMenuId(w), SUBMENU_CONDITIONAL);
            }
            break;

        case CF_END:
            return 0;
        default:
            return -1;
        }
    }
    return -1;
}
开发者ID:OS2World,项目名称:APP-EDITOR-fte,代码行数:55,代码来源:c_config.cpp

示例7: GetObj

void ledLightingDevice::OnChange()
{
	cout << "New Value: " << m_cur_value << endl;

	/* Update the D-Bus LightingObject */
	GetObj()->m_cur_status = m_cur_value.c_str();

	/* Notify status change */
	lighting_object_emitSignal(GetObj(), E_LIGHTING_OBJECT_SIGNAL_CHANGED_STATUS, "DeviceName=lighting1&Command=get_status");

	//DEV_AGENT->EmitSignalDeviceUpdate("DeviceName=lighting1&Command=get_status");
}
开发者ID:shaan420,项目名称:smartgateway,代码行数:12,代码来源:ledLightingDevice.cpp

示例8: GetObj

void TemperatureDevice::OnChange()
{
	cout << "New Value: " << m_cur_value << endl;

	/* Update the D-Bus TemperatureObject */
	GetObj()->m_cur_status = m_cur_value.c_str();

	/* Notify status change */
	temperature_object_emitSignal(GetObj(), E_TEMPERATURE_OBJECT_SIGNAL_CHANGED_STATUS, "DeviceName=temperature1&Command=get_status");

	//DEV_AGENT->EmitSignalDeviceUpdate("DeviceName=temperature1&Command=get_status");
}
开发者ID:shaan420,项目名称:smartgateway,代码行数:12,代码来源:TemperatureSensorDevice.cpp

示例9: GetTree

//****************************
void CObjInfo::OnCloseObj()
{
	if(GetTree())
	{
		GetTree()->RemoveFromList(GetObj(),GetObjName());
		SetTree(0);
	}
	else
	{
		if(bDeleteObj&&GetObj())
		{
			delete 	GetObj();
			SetObj(0);
		}
	}
};
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:17,代码来源:ObjInfo.cpp

示例10: LOG_DBG

SharedTrackablePtr
ObjRsrc::AllocObj(Trackable::ObjType type, string lookupName)
{
    if (lookupName.length() == 0) {
        LOG_DBG("Parameter lookupName has no value");
        return Trackable::NullTrackablePtr;
    }

    SharedTrackablePtr newObj = AllocWorker(type);
    if (newObj == Trackable::NullTrackablePtr) {
        LOG_DBG("System unable to create object from heap");
        return Trackable::NullTrackablePtr;
    }

    // Store this allocated object in a more permanent container
    pair<TrackableMap::iterator, bool> result;
    result = mObjGrpLife.insert(TrackablePair(lookupName, newObj));
    if (result.second == false) {
        LOG_DBG("Created object with collisions in lookupName: %s",
            lookupName.c_str());
        return Trackable::NullTrackablePtr;
    }

    return GetObj(lookupName);
}
开发者ID:Kurusamy,项目名称:tnvme,代码行数:25,代码来源:objRsrc.cpp

示例11: SetDuiTimer

	bool CDuiTimer::SetDuiTimer()
	{
		if((GetObj() && GetFun()) || GetHwnd())
			return InnerSetTimer();

		return false;
	}
开发者ID:shantj,项目名称:duilib,代码行数:7,代码来源:UITimer.cpp

示例12: GetObj

void CDlgView::WriteCoinfig(const string& strFilePath)
{
    Json::Value root;
    Json::Value arraycomm;
    Json::Value arraygame;
    Json::Value arraylager;
    Json::Value item;
    map<string ,ADD_APP_DATA>::const_iterator it = m_commapp_list.begin();
    for (; it!= m_commapp_list.end(); it++)
    {
        GetObj(it->second,item);
        root["commapp"].append(item);
    }

    it = m_gameapp_list.begin();
    for (; it!= m_gameapp_list.end(); it++)
    {
        GetObj(it->second,item);
        root["lagerapp"].append(item);
    }

    it = m_Largeapp_list.begin();
    for (; it!= m_Largeapp_list.end(); it++)
    {
        GetObj(it->second,item);
        root["lagerapp"].append(item);
    }

    ofstream outfile(strFilePath);
    if (!outfile.is_open())
    {
        return;
    }
    string strfile = root.toStyledString();
    outfile<<strfile;
    outfile.close();
    //CStdioFile  File;
    //if (File.Open((LPCTSTR)(LPSTR)strFilePath.c_str(),CFile::modeWrite | CFile::modeCreate))
    //{
    //	string strfile = root.toStyledString();
    //	File.WriteString(strfile.c_str());
    //	File.Close();
    //}
    //

}
开发者ID:SoyPay,项目名称:DacrsUI,代码行数:46,代码来源:DlgView.cpp

示例13: GetObj

void XFileTransferProxy::Reset(void)
{
    XFileTransfer *pFileTransfer;

    pFileTransfer = (XFileTransfer *) GetObj();

    if ( pFileTransfer )
        pFileTransfer->Reset();
}
开发者ID:xiaobinshe,项目名称:multitv,代码行数:9,代码来源:XFileTransferDll.cpp

示例14: surrounded

bool CGenerator::surrounded(glm::ivec3 vec)
{
	if(vec.z == -1)
		return true;
	bool is = true;
		for(int k = -1 ; k < 2 ; k++)
			for(int l = -1 ; l < 2 ; l++)
				if( GetObj(glm::ivec3(vec.x+k,vec.y+l,vec.z)) != 1 )
					is = false;
	return is;
}
开发者ID:Dreakii,项目名称:OpenWorld,代码行数:11,代码来源:CGenerator.cpp

示例15: GetObj

BOOL CMyHelpDoc::SaveModified() 
{
//	return CRichEditDoc::SaveModified();
	if(GetTree())//это режим в составе конфигурации
	{
		if(!GetObj()->bCanSave)
			return TRUE;

		CRichEditDoc::SetModifiedFlag(0);
		CString Str;
		((CMyHelpView*)GetView())->GetText(Str);
		GetObj()->csFile=Str;
		return TRUE;
	}
	else//это самостоятельный документ
	{
		return CRichEditDoc::SaveModified();
	}
	return TRUE;
}
开发者ID:open2cerp,项目名称:Open2C-ERP,代码行数:20,代码来源:MyHelpDoc.cpp


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