Glade Reference


dbObjList

A dbObjList is a list class containing dbObj objects. It is returned e.g by cellView::dbGetOverlaps()

 

list.clear()

Clears a dbObjList

 

int32_t dbObjList::size()

Returns the number of objects in a dbObjList

 

bool dbObjList::isEmpty()

Returns true if the dbObjList is empty, i.e. the size is zero.

 

bool dbObjList::member(dbObj *obj)

Returns true if the object obj is a member of the list, else false.

 

dbObjList::prepend(dbObj *obj)

Inserts the object at the beginning of the list. No list traversal is required.

 

dbObjList::append(dbObj *obj)

Inserts the object at the end of the list. No list traversal is required.

 

dbObjList::concat(dbObjList *otherlist)

Concatenate the two lists. otherlist is appended to the list, note this is a soft copy and otherlist remains unchanged.

 

int32_t dbObjList::remove(dbObj *obj)

Removes the object from the list. The list size is decremented. Returns 1 if the dbObj was found in the list, 0 if not. Beware: horrible things will happen if you remove a list item while using an iterator for that list.

 

dbObj *dbObjList::pop()

Pops an object from the front of the list; the size of the list is decremented by one.

 

dbObj * dbObjList::first()

Returns the first object in the list.

 

dbObj * dbObjList::next()

Returns the next object in the list, or null if the end of the list is reached. The iterator is incremented.

 

dbObj * dbObjList::peek()

Returns the next object in the list, or null if the end of the list is reached. The iterator is NOT incremented.

 

dbObj * dbObjList::last()

Returns the last object in the list, or null if the list is empty.

 

Casting to other types

Because many operations e.g. dbGetOverlaps() as mentioned above return a dbObjList with object as the base class, dbObj, there are swig wrapped C functions to cast to the derived type (you cannot cast in python).

See the dbObj class for a list of all cast functions.

 

Iterator

An iterator to allow traversing the objects in the dbObjList using Python.

 

iter = objIterator(dbObjList *list)

Initialises the dbObj iterator for the dbObjList. For example:

 
				# Find shapes on a layer in a given area and print their type
				#
				objs = cv.dbGetOverlaps(box, layer)
				iter = dbObjIterator(objs)
				while not iter.end() :
					obj = iter.value()
					type = obj.objType()
					print "object type = ", type
					iter.next()
				#
			

 

dbObj * iter.value()

Returns the current object.

 

iter.next()

Advances the iterator to the next dbObj.

 

bool iter.end()

Returns false if there are more objects, else returns true if there are no more.

 

 

Contents|Index

Copyright © Peardrop Design 2024.