TOP

Mobi_Mtld_DA_Carrier_BucketHandler

A bucket is a section of the data file. It has an ID, length and a byte array of data. Each bucket type has a specific format. This class handles the conversion of bucket data(binary bytes) to actual values. The following buckets are handled:
- Property Names - a unique list of property names. The order is the index.
- Property Values - a unique list of property values. The order is the index.
- Properties - collections of property name IDs to property value IDs
- IPv4 Radix Tree - contains the data for the left/right branches of a tree and property collection IDs
The bucket handler expects the buckets to be in the above order.
Author
DeviceAtlas Limited

Constants

BOOLEAN = 0

Type boolean

BYTE = 1

Type byte

DOUBLE = 6

Type double

FLOAT = 5

Type float

INTEGER = 3

Type int

LONG = 4

Type long int

SHORT = 2

Type short int

STRING = 7

Type string

UNKNOWN = 8

Unknown type

NO_CONTAINER = 0

for internal api use

NO_VALUE = -1

for internal api use

ORDER_SET_CONTAINER = 1

for internal api use

Static Methods

getName

string Mobi_Mtld_DA_Carrier_BucketHandler::getName(byte dataTypeID)

Get the name of a given data type.

Arguments

    dataTypeID (byte)
    The id to lookup the name for

Returns

string
The name of the data type.

Methods

getPropertyNames

[PropertyNames] $obj->getPropertyNames()

Returns the property names array

Returns

[PropertyNames]

getPropertyNamesAsStrings

Property $obj->getPropertyNamesAsStrings()

Returns the property names array

Returns

Property
names as string

getTreeLefts

array $obj->getTreeLefts()

Returns the Radix Trie "left" pointers

Returns

array
Radix Trie "left" pointers

getTreeProperties

array $obj->getTreeProperties()

Returns the properties used in the Radix Trie nodes

Returns

array
Radix Trie nodes

getTreeRights

array $obj->getTreeRights()

Returns the Radix Trie "right" pointers

Returns

array
Radix Trie "right" pointers

needsBuckets

bool $obj->needsBuckets()

Checks if all the necessary buckets have been supplied and processed.

Returns

bool
true if all buckets complete, FALSE otherwise

processBucket

void $obj->processBucket(int bucketId, string fileCrc32, string bucketData)

Process a bucket identified by "bucketId". The bucket CRC-32 hash is verified before parsing the bucket data.

Arguments

    bucketId (int)
    Bucket ID
    fileCrc32 (string)
    CRC number from the file
    bucketData (string)
    Data

Returns

void

Throws