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


C++ CBaseObject::ClassName方法代码示例

本文整理汇总了C++中CBaseObject::ClassName方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseObject::ClassName方法的具体用法?C++ CBaseObject::ClassName怎么用?C++ CBaseObject::ClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBaseObject的用法示例。


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

示例1: Remove

BOOL CObjects::Remove(CArrayBlockObjectPtr* papcKilled)
{
	int								i;
	int								iNumElements;
	CBaseObject*					pcKilled;
	CBaseObject*					pcContainer;

	//No embedded objects should be in the list papcKilled.

	iNumElements = papcKilled->NumElements();
	if (iNumElements == 0)
	{
		return TRUE;
	}

	for (i = 0; i < iNumElements; i++)
	{
		pcKilled = *papcKilled->Get(i);
		if (pcKilled->IsEmbedded())
		{
			pcContainer = pcKilled->GetEmbeddingContainer();
			gcLogger.Error2(__METHOD__, " Object of class [", pcKilled->ClassName(), "] is marked for killing but is embedded in object with index [", IndexToString(pcContainer->GetOI()),"] of class [", pcContainer->ClassName(), "].", NULL);
			return FALSE;
		}
		else if (!pcKilled->IsAllocatedInObjects())
		{
			gcLogger.Error2(__METHOD__, " Object of class [", pcKilled->ClassName(), "] is marked for killing but is not allocated in Objects [0x", PointerToString(this),"].", NULL);
			return FALSE;
		}
	}

	for (i = 0; i < iNumElements; i++)
	{
		pcKilled = *papcKilled->Get(i);
		pcKilled->RemoveAllPointerTosDontKill();
	}

	KillDontFreeObjects(papcKilled);
	FreeObjects(papcKilled);

	return TRUE;
}
开发者ID:chrisjaquet,项目名称:Codaphela.Library,代码行数:42,代码来源:Objects.cpp

示例2: LogNotExpectedToBeEmbedded

void CEmbeddedObject::LogNotExpectedToBeEmbedded(char* szMethod)
{
	CBaseObject*					pcContainer;

	pcContainer = GetEmbeddingContainer();
	gcLogger.Error2(szMethod, " Cannot be called on embedded object of class [", ClassName(), "] with embedding index [", IndexToString(pcContainer->GetOI()),"] and embedding class [", pcContainer->ClassName(), "].", NULL);
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:7,代码来源:EmbeddedObject.cpp

示例3: Add

CBaseObject* CObjectAllocator::Add(char* szClassName, char* szObjectName, OIndex oiForced, OIndex* poiExisting)
{
	CBaseObject*	pvObject;
	CBaseObject*	pvExisting;
	BOOL			bResult;

	pvObject = mpcObjects->Allocate(szClassName);
	if (!pvObject)
	{
		gcLogger.Error2(__METHOD__, " Cannot add object named [", szObjectName, "] class [", szClassName, "].", NULL);
		return NULL;
	}

	if (!pvObject->IsNamed())
	{
		gcLogger.Error2(__METHOD__, " Cannot add object named [", szObjectName, "] the class ", pvObject->ClassName(), " is not derived from NamedObject.", NULL);
		pvObject->Kill();
		return NULL;
	}

	pvExisting = mpcObjects->GetFromMemory(szObjectName);
	if (pvExisting == NULL)
	{
		bResult = mpcObjects->AddWithIDAndName(pvObject, szObjectName, oiForced);
		if (!bResult)
		{
			pvObject->Kill();
			return NULL;
		}
		LOG_OBJECT_ALLOCATION(pvObject);

		*poiExisting = INVALID_O_INDEX;
		return pvObject;
	}
	else
	{
		*poiExisting = pvExisting->GetOI();
		pvObject = ReplaceExisting(pvExisting, pvObject, szObjectName, oiForced);
		LOG_OBJECT_ALLOCATION(pvObject);

		return pvObject;
	}
}
开发者ID:andrewpaterson,项目名称:Codaphela.Library,代码行数:43,代码来源:ObjectAllocator.cpp


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