Public Member Functions | Protected Member Functions | Protected Attributes

Wizt::Fish< VObject > Class Template Reference

The Fish of a VObject is an abstract base class that holds a (native!) pointer to the Vish object that will be the owner of the various slots. More...

#include <Fish.hpp>

List of all members.

Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

template<>
class Wizt::Fish< VObject >

The Fish of a VObject is an abstract base class that holds a (native!) pointer to the Vish object that will be the owner of the various slots.

It is only used for the initialization of the slot classes. Therefore all the Fish objects are virtually derived from the Fish object. This ensures that the Fish object is initialized first, and all Fish slots may just use this already initialized pointer from their base class.

The concept is like in the following example. Note that the constructor A(99) is never called here, the argument 99 is completely irrelevant. Using this mechanism, we can give B an argument-free default constructor, and still providing it a well-initialized base class A, since A is constructed in the derived class, not in B.

#include <stdio.h>

struct  A
{
        A(int i)
        {
                printf("A: %d\n", i);
        }
};

struct  B : virtual A
{
        B()
        : A(99)
        {}
};

struct  C : B
{
        C()
        : A(23)
        {}
};

main()
{
C       cc;
}
Examples:

BoundingBox.cpp, BoundingBoxSimple.cpp, ComputeNormals.cpp, CrystalSurface.cpp, Dreibein.cpp, EvolutionSurface.cpp, FragmentBoxes.cpp, MonochromeSurface.cpp, PolychromeSurface.cpp, TransparentColoredSurface.cpp, and TransparentSurface.cpp.


Constructor & Destructor Documentation

Wizt::Fish< VObject >::Fish ( VObject that  )  [protected]

Fish scale constructor: Must provide the respective VISH Object here.

Will be used by other fish scales to initialize them, in particular to attach their slots to this VISH Object. It is thus vital for this VISH object to be initialized (constructed) before these other fish scales are called. It is not required (but still recommended) that the VISH object is initialized before this constructor is called. It does no more than store an internal (native!) pointer.