Public Member Functions | Private Member Functions | Static Private Attributes
tornado.util.Configurable Class Reference
Inheritance diagram for tornado.util.Configurable:
Inheritance graph
[legend]

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

def tornado.util.Configurable.__new__ (   cls,
  kwargs 
)

Definition at line 194 of file util.py.

def tornado.util.Configurable._restore_configuration (   cls,
  saved 
) [private]

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).

Reimplemented in tornado.ioloop.IOLoop, and tornado.httpclient.AsyncHTTPClient.

Definition at line 212 of file util.py.

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

Reimplemented in tornado.ioloop.IOLoop, and tornado.httpclient.AsyncHTTPClient.

Definition at line 221 of file util.py.

def 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.

Reimplemented in tornado.httpclient.AsyncHTTPClient.

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__``.

Reimplemented in tornado.ioloop.IOLoop, tornado.platform.asyncio.AsyncIOLoop, and tornado.platform.asyncio.AsyncIOMainLoop.

Definition at line 225 of file util.py.


Member Data Documentation

tornado::util.Configurable::__impl_class = None [static, private]

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_server
Author(s): Jonathan Mace
autogenerated on Wed Sep 13 2017 03:18:21