本文整理汇总了C++中BaseClass::copyBaseInterfaces方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseClass::copyBaseInterfaces方法的具体用法?C++ BaseClass::copyBaseInterfaces怎么用?C++ BaseClass::copyBaseInterfaces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseClass
的用法示例。
在下文中一共展示了BaseClass::copyBaseInterfaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: interfaceSemantic
void ClassDeclaration::interfaceSemantic(Scope *sc)
{
InterfaceDeclaration *id = isInterfaceDeclaration();
vtblInterfaces = new BaseClasses();
vtblInterfaces->reserve(interfaces_dim);
for (size_t i = 0; i < interfaces_dim; i++)
{
BaseClass *b = interfaces[i];
// If this is an interface, and it derives from a COM interface,
// then this is a COM interface too.
if (b->base->isCOMinterface())
com = 1;
#if 1
if (b->base->isCPPinterface() && id)
id->cpp = 1;
#else
if (b->base->isCPPinterface())
cpp = 1;
#endif
vtblInterfaces->push(b);
b->copyBaseInterfaces(vtblInterfaces);
}
}
示例2: copyBaseInterfaces
void BaseClass::copyBaseInterfaces(BaseClasses *vtblInterfaces)
{
//printf("+copyBaseInterfaces(), %s\n", base->toChars());
// if (baseInterfaces_dim)
// return;
baseInterfaces_dim = base->interfaces_dim;
baseInterfaces = (BaseClass *)mem.calloc(baseInterfaces_dim, sizeof(BaseClass));
//printf("%s.copyBaseInterfaces()\n", base->toChars());
for (size_t i = 0; i < baseInterfaces_dim; i++)
{
BaseClass *b = &baseInterfaces[i];
BaseClass *b2 = base->interfaces[i];
assert(b2->vtbl.dim == 0); // should not be filled yet
memcpy(b, b2, sizeof(BaseClass));
if (i) // single inheritance is i==0
vtblInterfaces->push(b); // only need for M.I.
b->copyBaseInterfaces(vtblInterfaces);
}
//printf("-copyBaseInterfaces\n");
}