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

 

int list.size()

Returns the number of objects in a dbObjList

 

bool list.isEmpty()

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

 

bool list.member(dbObj *obj)

Returns True if the object obj is a member of the list, else False.

 

list.prepend(dbObj *obj)

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

 

list.append(dbObj *obj)

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

 

list.concat(dbObjList *otherlist)

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

 

int list.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.

 

dbObj *list.pop()

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

 

dbObj * list.first()

Returns the first object in the list.

 

dbObj *list.next()

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

 

dbObj *list.peek()

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

 

dbObj *list.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 *obj = 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 2020.