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

Detailed Description

Class managing a set of entities.

Unlike the TSLEntitySet class, the entities stored in this class are not owned by the TSLEntityReferenceSet. This class is intended as a parameter passing mechanism for passing arrays of entities across the SDK boundary without introducing explicit dependencies on STL libraries etc.

NOTE : Instances of TSLEntityReferenceSet must be allocated on the heap since the allocation is redirected to MapLink. To prevent users creating these objects statically, automatically or embedded, the destructor is private. To destroy a TSLEntityReferenceSet, call the public destroy method, rather than the delete operator.

Public Member Functions

 TSLEntityReferenceSet ()
 
 TSLEntityReferenceSet (const TSLEntityReferenceSet &other)
 
 TSLEntityReferenceSet (const TSLEntity **entities, int numEntities)
 
bool add (const TSLEntity *entity, int index=-1)
 
bool clear ()
 
void destroy ()
 
const TSLEntityelementAt (int index) const
 
const TSLEntityoperator[] (int index) const
 
int size () const
 
bool remove (int index)
 
bool remove (const TSLEntity *entity)
 
void * operator new (size_t size) TSL_NO_THROW
 
void * operator new (size_t size, char *filename, int line)
 

Constructor & Destructor Documentation

◆ TSLEntityReferenceSet() [1/3]

TSLEntityReferenceSet::TSLEntityReferenceSet ( )

Default constructor.

Creates an empty entity reference set

Use the destroy method to destroy an instance of this class, rather than the delete operator.

◆ TSLEntityReferenceSet() [2/3]

TSLEntityReferenceSet::TSLEntityReferenceSet ( const TSLEntityReferenceSet & other)

Copy constructor.

Creates an entity reference set that is a copy of that specified.

Use the destroy method to destroy an instance of this class, rather than the delete operator.

◆ TSLEntityReferenceSet() [3/3]

TSLEntityReferenceSet::TSLEntityReferenceSet ( const TSLEntity ** entities,
int numEntities )

Constructor to create an entity reference set from a number of entities

Parameters
entitiesPointer to beginning of entities array
numEntitiesNumber of entities in array

Use the destroy method to destroy an instance of this class, rather than the delete operator.

Member Function Documentation

◆ add()

bool TSLEntityReferenceSet::add ( const TSLEntity * entity,
int index = -1 )

Add a new entity reference to the set.

Parameters
entityNew entity to append
indexPosition for new entity. If value is out of range, then new entity is appended.
Returns
true on success, false otherwise.

◆ clear()

bool TSLEntityReferenceSet::clear ( )

Clears the entity reference set.

◆ destroy()

void TSLEntityReferenceSet::destroy ( )

Destroy this entity reference set.

These must be destroyed using this call rather that being deleted.

◆ elementAt()

const TSLEntity * TSLEntityReferenceSet::elementAt ( int index) const

Access the entity at the specified index.

Parameters
indexIndex into entity reference set
Returns
the specified entity reference, 0 if the index is out of range.

◆ operator new() [1/2]

void * TSLEntityReferenceSet::operator new ( size_t size)

These are here to avoid being documented Allocation redirection for API.

◆ operator new() [2/2]

void * TSLEntityReferenceSet::operator new ( size_t size,
char * filename,
int line )

When included in an MFC application in debug mode, the debug new expects this to be here. Override it and return the same as the normal one. The library must include it when compiled in release mode, since the user's application may be in debug mode.

◆ operator[]()

const TSLEntity * TSLEntityReferenceSet::operator[] ( int index) const

Access the entity reference at the specified index.

Parameters
indexIndex into entity reference set
Returns
the specified entity reference, 0 if the index is out of range.

◆ remove() [1/2]

bool TSLEntityReferenceSet::remove ( const TSLEntity * entity)

Remove an entity reference from the set.

Parameters
entityEntity to remove.
Returns
true on success, false otherwise.

◆ remove() [2/2]

bool TSLEntityReferenceSet::remove ( int index)

Remove an entity reference from the set.

Parameters
indexPosition of entity to remove. If value is out of range, then last entity is appended.
Returns
true on success, false otherwise.

◆ size()

int TSLEntityReferenceSet::size ( ) const

Query the number of entities in the entity reference set.