Design of the C++ side of LibVob

This document discusses only the C++ side; the interface between C++ and Java is discussed elsewhere.

In order to make the code reusable by decoupling different aspects as well as possible, we have settled on the following package structure:

UML: vob_c_packages

This way the relationships between the different aspects of the system go through well-defined interfaces in the packages TransformInterfaces and VobInterfaces.

Interfaces

The transform interfaces and vob interfaces are relatively simple, defined in the include files vob/Transform.hxx and vob/Vob.hxx.

The central interfaces on the C side are Vob and Transform, corresponding to the Java side Vob design.

Vob Transform Design of LibVob Vob Transform Design of LibVob vobs_overall_2

In C++, however, transforms are real classes since the overhead is not significant.

Implementations: Code Generation

The TransformsImpl and VobImpl packages in the above diagram are a different story: in order to support extensibility and multiple language bindings, we rely on code generation and templates to create the glue code from a simple definition of the actual functionality.

The details of creating each type of class are documented separately (design_vobs, design_transforms)

Design of LibVob Design of LibVob C Design of LibVob C Design of LibVob Design of LibVob C Design of LibVob C design_navigation

A basic concept is the PrimitiveTransform, which is a simple parametrized function of points to points. The public members are as follows:

class PrimitiveTransform {
    enum { NParams = ???
    };
    template<class Ptr> void setParams(Ptr p) ;
    bool canPerformGL() ;
    void inverseTransform(InverseType &into) {
    }

    void tr(const ZPt &from, ZPt &to) const ;
    bool performGL() ;
    
}

In order to maximize efficiency, none of the member functions are virtual.