The methods of the idGen class are used to generate unique IDs in various forms (numbers, strings, etc) which are used to give microprocesses and other Axon objects a unique identifier and name.
Generating a new unique IDDo not use the idGen class defined in this module directly. Instead, use any of these module methods to obtain a unique ID:
Calling tupleId(thing) is not equivalent to calling numId() then strId(thing) because doing that would return two different id values! Examples: >>> x=Component.component() >>> idGen.newId(x) 'Component.component_4' >>> idGen.strId(x) 'Component.component_5' >>> idGen.numId() 6 >>> idGen.tupleId(x) (7, 'Component.component_7') Axon.idGen.idGenclass idGen(object)Unique ID creator. Use numId(), strId(), and tupleId() methods to obtain unique IDs. Methods defined hereidToString(self, thing, aNumId)INTERNAL Combines the 'str()' of the object's class with the id to form a string id numId(self)Allocates & returns the next available id strId(self, thing)Allocates & returns the next available id combined with the object's class name, in string form tupleId(self, thing)Allocates the next available id and returns it both as a tuple (num,str) containing both the numeric version and a string version where it is combined with the object's class name. FeedbackGot a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording! Please leave you feedback here in reply to the documentation thread in the Kamaelia blog. -- Automatic documentation generator, 01 Feb 2010 at 04:00:28 UTC/GMT |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved