C++高性能并行编程与优化 - 课件 - Zeno 中的现代 C++ 最佳实践 Descriptor.cpp Descriptor.h Graph.cpp Graph.h INode.cpp INode.h IObject.cpp IObject.h loadGraph.cpp Session.cpp Session.h extra/ funcs/ [X]nodes/ mtl/ num/ [X]prim/ PrimitiveObiIO.cpp ## 多态的经典案例 - IObject 具有一个 eatFood 纯虚函数,而 CatObject 和 DogObject 继承自 IObject,他们实现了 eatFood 这个虚函数,实现了多态。 - 注意这里解构函数(~IObject)也需要是虚函数,否则以 IObject * 存储的指针在 delete 时只会释放 IObject 里的成员,而不会释放 CatObject 用不同派生类的解构函数。 struct IObject { IObject() = default; IObject(IObject const &) = default; IObject &operator=(IObject const &) = default; virtual ~IObject() = default; virtual0 码力 | 54 页 | 3.94 MB | 2 年前3
Oracle VM VirtualBox 3.2.10 Programming Guide and Referencewhat you need is IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ rc = object->vtbl->Method(object, arg, ...); IFoo *foo; /* * Calling IFoo IObject::method(arg, ..0 码力 | 247 页 | 1.62 MB | 1 年前3
Oracle VM VirtualBox 3.2.28 Programming Guide and Referencelocation. In other words, to call an object’s method what you need is IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ rc = object->vtbl->Method(object, arg, ...); ... 34 34 5 The VirtualBox COM/XPCOM API IFoo *foo; /* * Calling IFoo IObject::method(arg, ...) */ rc = object->vtbl->Method(object, args, ..., &foo); As a real-world example of a method invocation, let’s call0 码力 | 247 页 | 1.63 MB | 1 年前3
Oracle VM VirtualBox 4.0.32 Programming Guide and Referencelocation. In other words, to call an object’s method what you need is IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ ## 2 Environment-specific notes rc = object-> object->vtbl->Method(object, arg, ...); ... IFoo *foo; /* * Calling IFoo IObject::method(arg, ...) */ rc = object->vtbl->Method(object, args, ..., &foo); As a real-world example of a method invocation0 码力 | 291 页 | 1.84 MB | 1 年前3
Oracle VM VirtualBox 4.1.20 Programming Guide and Referencelocation. In other words, to call an object’s method what you need is IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ ## 2 Environment-specific notes rc = object-> object->vtbl->Method(object, arg, ...); ... IFoo *foo; /* * Calling IFoo IObject::method(arg, ...) */ rc = object->vtbl->Method(object, args, ..., &foo); As a real-world example of a method invocation0 码力 | 306 页 | 1.92 MB | 1 年前3
Oracle VM VirtualBox 4.1.40 Programming Guide and Referencelocation. In other words, to call an object’s method what you need is IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ ## 2 Environment-specific notes rc = object-> object->vtbl->Method(object, arg, ...); ... IFoo *foo; /* * Calling IFoo IObject::method(arg, ...) */ rc = object->vtbl->Method(object, args, ..., &foo); As a real-world example of a method invocation0 码力 | 306 页 | 1.92 MB | 1 年前3
Oracle VM VirtualBox 4.2.8 Programming Guide and Referencelocation. In other words, to call an object’s method what you need is IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ ## 2 Environment-specific notes rc = object-> object->vtbl->Method(object, arg, ...); ... IFoo *foo; /* * Calling IFoo IObject::method(arg, ...) */ rc = object->vtbl->Method(object, args, ..., &foo); As a real-world example of a method invocation0 码力 | 339 页 | 2.07 MB | 1 年前3
Oracle VM VirtualBox 4.3.6 Programming Guide and ReferenceEnvironment-specific notes IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ rc = object->vtbl->Method(object, arg, ...); IFoo *foo; /* * Calling IFoo IObject::method(arg, ..0 码力 | 371 页 | 2.23 MB | 1 年前3
Oracle VM VirtualBox 4.2.32 Programming Guide and ReferenceEnvironment-specific notes IObject *object; nsresult rc; ... /* * Calling void IObject::method(arg, ...) */ rc = object->vtbl->Method(object, arg, ...); ... IFoo *foo; /* * Calling IFoo IObject::method(arg,0 码力 | 339 页 | 2.07 MB | 1 年前3
共 9 条
- 1













