Public Member Functions | Private Member Functions | Static Private Attributes
rosbridge_tools.tornado.util.Configurable Class Reference

List of all members.

Public Member Functions

def __new__
def configurable_base
def configurable_default
def configure
def configured_class
def initialize

Private Member Functions

def _restore_configuration
def _save_configuration

Static Private Attributes

 __impl_class = None
 __impl_kwargs = None

Detailed Description

Base class for configurable interfaces.

A configurable interface is an (abstract) class whose constructor
acts as a factory function for one of its implementation subclasses.
The implementation subclass as well as optional keyword arguments to
its initializer can be set globally at runtime with `configure`.

By using the constructor as the factory method, the interface
looks like a normal class, `isinstance` works as usual, etc.  This
pattern is most useful when the choice of implementation is likely
to be a global decision (e.g. when `~select.epoll` is available,
always use it instead of `~select.select`), or when a
previously-monolithic class has been split into specialized
subclasses.

Configurable subclasses must define the class methods
`configurable_base` and `configurable_default`, and use the instance
method `initialize` instead of ``__init__``.

Definition at line 171 of file util.py.


Member Function Documentation

Definition at line 194 of file util.py.

Definition at line 261 of file util.py.

Definition at line 256 of file util.py.

Returns the base class of a configurable hierarchy.

This will normally return the class in which it is defined.
(which is *not* necessarily the same as the cls classmethod parameter).

Definition at line 212 of file util.py.

Returns the implementation class to be used if none is configured.

Definition at line 221 of file util.py.

def rosbridge_tools.tornado.util.Configurable.configure (   cls,
  impl,
  kwargs 
)
Sets the class to use when the base class is instantiated.

Keyword arguments will be saved and added to the arguments passed
to the constructor.  This can be used to set global defaults for
some parameters.

Definition at line 232 of file util.py.

Returns the currently configured class.

Definition at line 248 of file util.py.

Initialize a `Configurable` subclass instance.

Configurable classes should use `initialize` instead of ``__init__``.

Definition at line 225 of file util.py.


Member Data Documentation

Definition at line 191 of file util.py.

Definition at line 192 of file util.py.


The documentation for this class was generated from the following file:


rosbridge_tools
Author(s): Jonathan Mace
autogenerated on Sat Dec 27 2014 11:26:00