DADL - Data Access Definition Language

The Data Access Definition Language is used to define access types for foster. The defined elements form a set of access classes and normally for every application or part of an application a new dadl file is used.

The following sections describe the basic elements of the language.

Comments

You can write comments in the files in the C++ format.

    // Comment Type 1

    /* Command Type 2 */

list, struct

Lists and structs are not really defined. They use the structure given by the DTDL definition. All you do is importing and defining the name you want to use.

    // define WMyList to use the DTDL list MyList of namespace a::b
    list WMyList a::b::MyList;

object

Objects are the main elements in DADL. An object is defined by selecting the DTDL classes it should contain and the attributes for which access functions should be generated.

    object WMyObject
    {
        MyClass
        {
            Title       [ get, set, remove ];
            Description [ get, set, remove ];
        }

        Class2
        {
            Link        [ get, set ];
        }

        create(WOtherObject);
        open(WOtherObject);
    };

The example defines an object with 2 DTDL classes and functions for 3 attributes. Additionally a create and open function for WOtherObject objects are generated.

Types of attribute functions: get, set, remove, create, open, extend, reduce, delete
the get, set, remove can only be defined for attributes, the other functions are also allowed as static object functions.

global functions

If you need to open a root object, global functions are useful. Those can be defined outside of the objects, the same way static functions are defined in objects.

bitflag sets

bitflag sets can be defined... this feature will be supported soon

Preprocessor

The language uses to types of preprocessor commands. The #import and #include. They both load an external file. While #include imports the file and all definitions inside completely, the #import command is used to import bdtd data (compiled dtdl definitions).

The difference between the <path> and "path" format is how the file is searched. While "path" takes the current file as starting point, <path> takes the input directories passed to the compiler as starting point for the search.

    #include <file.dtdl>
    #include "..\directory\file.dtdl"
© 2020 Mobiland AG