Package sabx10 :: Package osm :: Module utils :: Class BaseId
[hide private]
[frames] | no frames]

Class BaseId

source code

object --+
         |
        BaseId
Known Subclasses:

Generate sequential, unique ids.

Instance Methods [hide private]
 
__init__(self, start_id=1)
Save the starting id.
source code
int
next(self)
Get the next id in the sequence and increment it.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
int next_id
next id to return
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, start_id=1)
(Constructor)

source code 

Save the starting id.

Parameters:
  • start_id (int) - starting id
Overrides: object.__init__

next(self)

source code 

Get the next id in the sequence and increment it.

Returns: int
next id