code::ControlLB Class Reference

Inheritance diagram for code::ControlLB:

code::AlgorithmControl code::ActionSource List of all members.

Detailed Description

Provides control to algorithms using a linear buffer.

This is not meant to be used directly. Instead, it will typically be created using Factory<AlgorithmControl>

Author:
Lakshman
Version:
Id
code_ControlLB.h,v 1.4 2009/06/02 20:17:38 lakshman Exp


Public Member Functions

 ControlLB (const code::URL &lbname)
void actOn (const Buffer &msg)
virtual SmartPtr< AlgorithmControlcreateAlgorithmControl (const URL &url)
 subclasses should over-ride this method, acting as a prototype factory, returning another object of your type.
void copyListenersFrom (const ActionSource &other)
 copy all the listeners from the other source (replacing our own)
size_t getNumListeners () const
 returns the number of listeners linked to this source.
std::string getDir ()
 Returns a source-specific disk directory.
void addActionListener (SmartPtr< ActionListener > lstnr)
 Subscribe lstnr such that it receives all events from this ActionSource.
void addActionListener (const std::string &event_type, SmartPtr< ActionListener > lstnr)
 Subscribe lstnr such that it receives only this event type from this ActionSource.
void removeActionListener (SmartPtr< ActionListener > lstner)
 Unsubscribe lstnr such that it no longer receives events from this ActionSource.
void removeActionListener (const std::string &eventType, SmartPtr< ActionListener > lstner)
 Unsubscribe the listener so that it does not respond to the the event type noted.
void fireActionPerformed (const ActionEvent &e)
 Convenience function for subclasses to notify ActionListeners of events.
void fireActionPerformed (const ActionEvent *e)
 Convenience function for subclasses to notify ActionListeners of events.
void fireActionPerformed (const std::string &type)
 Convenience function for subclasses to notify ActionListeners of events.

Static Public Member Functions

static void introduceSelf ()
static AlgorithmControlinstance ()
 return this process' current controller.
static void setAlgorithmControl (SmartPtr< AlgorithmControl > newControl)
 Use newControl as this process' controller.
static void setAlgorithmControl (const URL &url)

Protected Member Functions

void notify (const std::string &xmlContent)
 The content should be XML with tagname "control" or having children with that tagname.
void notify (const XML::Element &e)
 The content should be XML with tagname "control" or having children with that tagname.


Constructor & Destructor Documentation

code::ControlLB::ControlLB ( const code::URL lbname  ) 


Member Function Documentation

void code::ControlLB::actOn ( const Buffer msg  ) 

void code::ActionSource::addActionListener ( const std::string &  event_type,
SmartPtr< ActionListener lstnr 
) [inline, inherited]

Subscribe lstnr such that it receives only this event type from this ActionSource.

Parameters:
evt_type the event type we are subscribing to
lstnr the action listener to be subscribed.

void code::ActionSource::addActionListener ( SmartPtr< ActionListener lstnr  )  [inline, inherited]

Subscribe lstnr such that it receives all events from this ActionSource.

Parameters:
l the action listener to be subscribed.

void code::ActionSource::copyListenersFrom ( const ActionSource other  )  [inline, inherited]

copy all the listeners from the other source (replacing our own)

virtual SmartPtr<AlgorithmControl> code::ControlLB::createAlgorithmControl ( const URL url  )  [virtual]

subclasses should over-ride this method, acting as a prototype factory, returning another object of your type.

Reimplemented from code::AlgorithmControl.

void code::ActionSource::fireActionPerformed ( const std::string &  type  )  [inline, inherited]

Convenience function for subclasses to notify ActionListeners of events.

Parameters:
type the type of the ActionEvent to be passed along to the action listeners.

void code::ActionSource::fireActionPerformed ( const ActionEvent e  )  [inline, inherited]

Convenience function for subclasses to notify ActionListeners of events.

Parameters:
actionEvent the event to be passed along to the action listeners.

void code::ActionSource::fireActionPerformed ( const ActionEvent e  )  [inline, inherited]

Convenience function for subclasses to notify ActionListeners of events.

Parameters:
actionEvent the event to be passed along to the action listeners.

std::string code::ActionSource::getDir (  )  [inline, inherited]

Returns a source-specific disk directory.

Default implementation does nothing --- this should be overridden.

Returns:
a source-specific type identifier to indicate what action occurred.

size_t code::ActionSource::getNumListeners (  )  const [inline, inherited]

returns the number of listeners linked to this source.

static AlgorithmControl& code::AlgorithmControl::instance (  )  [static, inherited]

return this process' current controller.

static void code::ControlLB::introduceSelf (  )  [static]

void code::AlgorithmControl::notify ( const XML::Element e  )  [protected, inherited]

The content should be XML with tagname "control" or having children with that tagname.

void code::AlgorithmControl::notify ( const std::string &  xmlContent  )  [protected, inherited]

The content should be XML with tagname "control" or having children with that tagname.

void code::ActionSource::removeActionListener ( const std::string &  eventType,
SmartPtr< ActionListener lstner 
) [inline, inherited]

Unsubscribe the listener so that it does not respond to the the event type noted.

This works only if the listener was added via addActionListener( type, SmartPtr )

Parameters:
type The event type
lstnr The listener to remove

void code::ActionSource::removeActionListener ( SmartPtr< ActionListener lstner  )  [inline, inherited]

Unsubscribe lstnr such that it no longer receives events from this ActionSource.

Parameters:
lstnr the action listener to be unsubscribed.

static void code::AlgorithmControl::setAlgorithmControl ( const URL url  )  [static, inherited]

static void code::AlgorithmControl::setAlgorithmControl ( SmartPtr< AlgorithmControl newControl  )  [static, inherited]

Use newControl as this process' controller.

Any existing control is removed after its listeners are transferred over, so the change of control is transparent to existing listeners.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7