ServerPortfolio  2.0
Python parsers and server
 All Classes Namespaces Files Functions Variables Properties Pages
Public Member Functions | Static Private Attributes | List of all members
serverportfolio.DictionaryStocks.Singleton Class Reference

Define a metaclass Singleton object. More...

Inheritance diagram for serverportfolio.DictionaryStocks.Singleton:
Inheritance graph
[legend]
Collaboration diagram for serverportfolio.DictionaryStocks.Singleton:
Collaboration graph
[legend]

Public Member Functions

def __call__
 Executed at the object creation, created only once. More...
 

Static Private Attributes

dictionary _instances = {}
 

Detailed Description

Define a metaclass Singleton object.

Note
Due to the naming convention in python, a "main" cannot be run inside the same file.
The object will be named main.DictionaryStocks inside the file, and a different instance would be created by other modules.
See unit-test for _drop() function in order to "delete" a Singleton.

Definition at line 40 of file DictionaryStocks.py.

Member Function Documentation

def serverportfolio.DictionaryStocks.Singleton.__call__ (   cls,
  args,
  kwargs 
)

Executed at the object creation, created only once.

Then return the saved instance.

Definition at line 44 of file DictionaryStocks.py.

Member Data Documentation

dictionary serverportfolio.DictionaryStocks.Singleton._instances = {}
staticprivate

Definition at line 41 of file DictionaryStocks.py.


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