InPortConsumer.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- coding: euc-jp -*-
00003 
00004 
00005 ##
00006 # @file  InPortConsumer.py
00007 # @brief InPortConsumer class
00008 # @date  $Date: 2007/09/04$
00009 # @author Noriaki Ando <n-ando@aist.go.jp> and Shinji Kurihara
00010 #
00011 # Copyright (C) 2006-2008
00012 #     Noriaki Ando
00013 #     Task-intelligence Research Group,
00014 #     Intelligent Systems Research Institute,
00015 #     National Institute of
00016 #         Advanced Industrial Science and Technology (AIST), Japan
00017 #     All rights reserved.
00018 
00019 
00020 import OpenRTM_aist
00021 
00022 ##
00023 # @if jp
00024 #
00025 # @class InPortConsumer
00026 #
00027 # @brief InPortConsumer 基底クラス
00028 #
00029 # 入力ポートコンシューマのための抽象インターフェースクラス
00030 # 各具象クラスは、以下の関数の実装を提供しなければならない。
00031 # - push(): データ送信
00032 # - clone(): ポートのコピー
00033 # - subscribeInterface(): データ送出通知への登録
00034 # - unsubscribeInterface(): データ送出通知の登録解除
00035 #
00036 # @since 0.4.0
00037 #
00038 # @else
00039 # @class InPortConsumer
00040 # @brief InPortConsumer class
00041 # @endif
00042 class InPortConsumer(OpenRTM_aist.DataPortStatus):
00043   """
00044   """
00045 
00046 
00047 
00048   ##
00049   # @if jp
00050   # @brief インターフェースプロファイルを公開するたのファンクタ
00051   # @else
00052   # @brief Functor to publish interface profile
00053   # @endif
00054   #
00055   class publishInterfaceProfileFunc:
00056     def __init__(self, prop):
00057       self._prop = prop
00058 
00059     def __call__(self, consumer):
00060       consumer.publishInterfaceProfile(self._prop)
00061 
00062 
00063   ##
00064   # @if jp
00065   # @brief インターフェースプロファイルを公開するたのファンクタ
00066   # @else
00067   # @brief Functor to publish interface profile
00068   # @endif
00069   #
00070   class subscribeInterfaceFunc:
00071     def __init__(self, prop):
00072       self._prop = prop
00073 
00074     def __call__(self, consumer):
00075       return consumer.subscribeInterface(self._prop)
00076 
00077 
00078 inportconsumerfactory = None
00079 
00080 class InPortConsumerFactory(OpenRTM_aist.Factory,InPortConsumer):
00081 
00082   def __init__(self):
00083     OpenRTM_aist.Factory.__init__(self)
00084     pass
00085 
00086 
00087   def __del__(self):
00088     pass
00089 
00090 
00091   def instance():
00092     global inportconsumerfactory
00093 
00094     if inportconsumerfactory is None:
00095       inportconsumerfactory = InPortConsumerFactory()
00096 
00097     return inportconsumerfactory
00098 
00099   instance = staticmethod(instance)
00100 


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Aug 27 2015 14:17:28