/* (c) 1999-2005, Rony G. Flatscher, Wirtschaftsuniversitaet Wien, Austria Europe
   A *possible* solution to excercise # 17
*/

::CLASS Manager         SUBCLASS Class  PUBLIC

::METHOD Init
  EXPOSE Managed_Objects
  Managed_Objects = .bag~new
  self~init:super

::METHOD Managed_Objects ATTRIBUTE

::METHOD New
  FORWARD CLASS (super) CONTINUE
  tmpObj = RESULT
  self~Managed_Objects~put(tmpObj)
  RETURN tmpObj

::METHOD Broadcast
  USE ARG message, bSynchroneously
  bSynchroneously = (bSynchroneously=.true)
  IF bSynchroneously THEN SAY "Manager.Broadcast: invoking messages synchroneously..."
                     ELSE SAY "Manager.Broadcast: invoking messages asynchroneously..."

  DO item OVER self~Managed_Objects
     IF bSynchroneously THEN message~copy~send(item)
                        ELSE message~copy~start(item)
  END

