Here an ooRexx implementation of the proposed TraceObject class in today's "Proposal for multithreaded trace prefix" class:

   /* ========================================================================= 
*/ ::class
   "TraceObject" subclass StringTable public /*
   ------------------------------------------------------------------------- */ 
::attribute
   mtPrefix class -- if .true causes the mtPrefix to be created /*
   ------------------------------------------------------------------------- */ 
::method MAKESTRING
   if self~class~mtPrefix<>.true then -- do not show multithreaded prefix return 
self["TRACELINE"]
   -- return standard trace line mb = .MutableBuffer~new -- for performance reasons 
mb~append("[")
   mb~append("R", adjLeft(self["INSTANCE"] ,3), " ") -- R_exx interpreter instance 
mb~append("T",
   adjLeft(self["THREAD"] ,3), " ") -- T_hread/activity mb~append("I",
   adjLeft(self["INVOCATION"],3) ) -- I_nvocation/activation 
vd=self["VARIABLEDICTIONARY"] if vd<>0
   then -- an object's variable dictionary in hand, we are in a method do 
mb~append(" ")
   mb~append(self["ISGUARDED"]~?("G","U") , " ") -- G_uarded or U_unguarded 
mb~append("V",
   adjLeft(vd ,3), " ") -- V_ariable dictionary pool mb~append("L", 
adjLeft(self["LOCKCOUNT"],3), "
   ") -- L ... lock reserve count mb~append(self["ISLOCKED"]~?("*"," ")) -- 
asterisk to indicate
   holding object lock (can execute) end mb~append("] ", self["TRACELINE"]) 
return mb~string --
   return trace line with mtPrefix adjLeft: procedure -- left adjust, but make 
sure we show all
   chars use arg value, width if value~length>=width then -- no left adjustment 
return value return
   value~left(width) -- left adjust with given width

---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to