fnGetAttributeType


Prototype

unsigned long __cdecl fnGetAttributeType ( unsigned long ulThemeKey, size_t nCol ); 

Return value

Type of this attribute column.

Parameters

ulThemeKey

Theme specific data. This value was defined by the plugin in the fnLoadShapes function.

nCol

Zero-based index of the column in question. 0 <= nCol < fnGetAttributeCount(ulThemeKey).

Remarks

Implementing this function enables some functionality in ShapeUp. E.g. the Query selector will be able to perform better when knowing the type of each attribute. It also affects sorting. One of the following values can be used:

AT_STRING
AT_INT
AT_DOUBLE
AT_DATE
AT_BOOL

Also, one ore more columns can be part of a primary key, specifying a unique referense to that shape. To specify that a column is part of a primary key, any of the above can be OR'ed with:

AT_PRIMARYKEY

Notice: The loader is responsible for the integrity of the primary key.

If this function is omitted, all columns are treated as string data and no primary keys will be set.

Example

size_t __cdecl fnGetAttributeType ( unsigned long ulThemeKey, size_t nCol )
{
    MyThemeData *pData = (MyThemeData*) ulThemeKey;

    switch (nCol)
    {
    case 0:
        return AT_INT | AT_PRIMARYKEY;
    case 1:
        return AT_DOUBLE;
    default:
        break;
    }

    return AT_STRING;
} 

See Also

Loader API, fnLoadShapes, fnGetAttributeCount