本文整理汇总了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;
}
示例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);
}
示例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;
}
}