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


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