MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLDataSet Class Reference

Detailed Description

Entity specific DataSet access methods.

Allows access to the Data held by an individual TSLEntity.

Public Member Functions

bool addData (const TSLVariant *values, int count)
 
bool addData (const TSLVariant &value)
 
void copy (const TSLDataSet *source)
 
TSLDataHandlerdataHandler () const
 
const char * findKey (const char *field_name) const
 
const char * findName (const char *field_key) const
 
bool getAvailableField (int index, TSLSimpleString &field) const
 
bool getAvailableKey (int index, TSLSimpleString &key) const
 
const TSLVariantgetData (int position, bool search_external=false) const
 
const TSLVariantgetData (const char *id, int nth_copy=0, bool search_external=false) const
 
bool readOnly () const
 
int numAvailableFields () const
 
int numAvailableKeys () const
 
bool removeData (int position)
 
bool removeData (const char *id, int nth_copy=0)
 
int sizeData (bool search_external=false) const
 
int sizeData (const char *id, bool search_external=false) const
 
bool updateData (const TSLVariant &value, int position)
 
bool updateData (const TSLVariant &value, const char *id, int nth_copy=0)
 

Member Function Documentation

◆ addData() [1/2]

bool TSLDataSet::addData ( const TSLVariant & value)

Handles the addition of a single variants to the TSLDataSet. Addition is not allowed if the TSLDataSet is read only as in the case of TSLDataSet for TSLEntities retrieved from a TSLMapDataLayer.

Parameters
valuereference to a single TSLVariant object to be added.
Returns
True if data is successfully added, false otherwise.

◆ addData() [2/2]

bool TSLDataSet::addData ( const TSLVariant * values,
int count )

Handles the addition of a set of variants to the TSLDataSet. Addition is not allowed if the TSLDataSet is read only as in the case of TSLDataSet for TSLEntities retrieved from a TSLMapDataLayer.

Parameters
valuespointer to the first of a set of TSLVariants
countnumber of TSLVariants being passed in pass
Returns
True if successfully added, false otherwise.

◆ copy()

void TSLDataSet::copy ( const TSLDataSet * source)

Copies the contents of the given TSLDataSet into this TSLDataSet. This operation erases any existing data within this dataset.

The TSLDataHandler associated with this dataset (if any) is unaffected by this operation.

Parameters
sourceThe TSLDataSet to copy the contents of.

◆ dataHandler()

TSLDataHandler * TSLDataSet::dataHandler ( ) const

Returns a pointer to the data handler for this dataset.

The data handler can be used to determine the name, and optionally the type and length, for a given field key.

Returns
a pointer to the data handler.

◆ findKey()

const char * TSLDataSet::findKey ( const char * field_name) const

Gets the two character field key which identifies a data attribute associated with the specified human readable field name for an entity of the feature type which owns the TSLDataSet.

Parameters
field_namehuman readable field name.
Returns
The two character code associated with the human readable name. If the field name is not understood by the handler then the method will return 0.

◆ findName()

const char * TSLDataSet::findName ( const char * field_key) const

Gets the human readable field name which identifies a data attribute associated with the specified 2 character field_key for an entity of the feature type which owns the TSLDataSet.

Parameters
field_keyThe two character identifier for which data attribute to recover.
Returns
human readable field name.

◆ getAvailableField()

bool TSLDataSet::getAvailableField ( int index,
TSLSimpleString & field ) const

Gets the indexed field name

Parameters
indexindex to the field name to retrieve. This should be less than the return value for numAvailableFields.
fieldThis will be populated with the field found at the passed index, should one exist.
Returns
true if and entry is found, false otherwise,

◆ getAvailableKey()

bool TSLDataSet::getAvailableKey ( int index,
TSLSimpleString & key ) const

Gets the indexed key name.

Parameters
indexindex to the key name to retrieve. This should be less than the return value for numAvailableKeys.
keyThis will be populated with the key found at the passed index, should one exist.
Returns
true if and entry is found, false otherwise,

◆ getData() [1/2]

const TSLVariant * TSLDataSet::getData ( const char * id,
int nth_copy = 0,
bool search_external = false ) const

Gets the nth_copy of a data attribute identified by id. If search external is set it will also search any external data sources if available.

Parameters
idIdentifier for the data element to be retrieved. This may be the two character code of the TSLVariant to retrieve or the human readable version of the code.
nth_copyThe count of the data identified by "id" to be retrieved. If no position is given the first occurrence is to be retrieved. Otherwise the valid range of inputs is from 1 (the first item) to the value returned by sizeData( id ) (the last item).
search_externalIndicates if any external data sources should be searched. If no value is given no external search will be undertaken.
Returns
a pointer to a TSLVariant with the given id at the requested position, or 0 if no valid data attribute was found.

◆ getData() [2/2]

const TSLVariant * TSLDataSet::getData ( int position,
bool search_external = false ) const

Gets the data attribute at the position specified. If search external is set it will also search any external data sources if available.

Parameters
positionThe position of the data attribute to retrieve.
search_externalIndicates if any external data sources should be searched. If no value is given no external search will be undertaken.
Returns
a pointer to a TSLVariant at the given position, or 0 if no valid data attribute was found.

◆ numAvailableFields()

int TSLDataSet::numAvailableFields ( ) const

Counts the available human readable field names for this dataset

Returns
number of fields if any were found, 0 otherwise.

◆ numAvailableKeys()

int TSLDataSet::numAvailableKeys ( ) const

Count of the available keys understood by this TSLDataSet

Returns
number of keys if any were found, 0 otherwise.

◆ readOnly()

bool TSLDataSet::readOnly ( ) const

Indicates if the TSLDataSet is read only.

Returns
True if the TSLDataSet is read only, false otherwise.

◆ removeData() [1/2]

bool TSLDataSet::removeData ( const char * id,
int nth_copy = 0 )

Removes nth_copy of the data attribute identified by the given id. Removal is not allowed if the TSLDataSet is read only as in the case of TSLDataSet for TSLEntities retrieved from a TSLMapDataLayer.

Parameters
idIdentifier for the data element to be removed.
nth_copyThe index of the data attribute with the given id that is to be removed.
Returns
True if the data attribute was found and removed, false otherwise.

◆ removeData() [2/2]

bool TSLDataSet::removeData ( int position)

Removes data at the given position.

Removal is not allowed if the TSLDataSet is read only as in the case of TSLDataSet for TSLEntities retrieved from a TSLMapDataLayer.

Parameters
positionthe position of the data attribute to remove
Returns
True if the data attribute was successfully removed, false otherwise.

◆ sizeData() [1/2]

int TSLDataSet::sizeData ( bool search_external = false) const

Counts the number of available items in the TSLDataSet

Parameters
search_externalindicates if any external data sources should be searched when calculating the count.
Returns
the number of data attributes stored.

◆ sizeData() [2/2]

int TSLDataSet::sizeData ( const char * id,
bool search_external = false ) const

Counts the number of available items with the given id.

Parameters
idthe id of the attribute to get
search_externalindicates if any external data sources should be searched when calculating the count.
Returns
the number of data items stored.

◆ updateData() [1/2]

bool TSLDataSet::updateData ( const TSLVariant & value,
const char * id,
int nth_copy = 0 )

Updates the nth copy of the specific variant id.

Not allowed if the TSLDataSet is read only.

This will not allow changes to any of the MapLink specific attributes or to any external data items. Note that this does not change the 'key' or 'id', merely update the value.

Parameters
valuereference to the TSLVariant object that is to update the TSLDataSet
idIdentifier for the data element to be updated. This may be the two character code of the TSLVariant to retrieve or the human readable version of the code.
nth_copyThe count of the data identified by "id" to be retrieved. If no position is given the first occurrence is to be updated.
Returns
True if the data was successfully updated. False otherwise.

◆ updateData() [2/2]

bool TSLDataSet::updateData ( const TSLVariant & value,
int position )

Updates the variant at the specified position for the entity.

Not allowed if the TSLDataSet is read only.

This will not allow changes to any of the MapLink specific attributes or to any external data items. Note that this method replaces the variant totally, not just updating the value. This means that the 'id' or 'key' could change.

Parameters
valuereference to the TSLVariant object that is to update the TSLDataSet
positionthe position of the data attribute in the TSLDataSet to update.
Returns
True if the data was successfully updated. False otherwise.