00001 #!/usr/bin/env python 00002 # -*- coding: euc-jp -*- 00003 00004 ## 00005 # @file PublisherFlush.py 00006 # @brief PublisherFlush class 00007 # @date $Date: 2007/09/06$ 00008 # @author Noriaki Ando <n-ando@aist.go.jp> 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 00019 import OpenRTM 00020 00021 00022 ## 00023 # @if jp 00024 # @class PublisherFlush 00025 # @brief PublisherFlush クラス 00026 # 00027 # Flush 型 Publisher クラス 00028 # バッファ内に格納されている未送信データを送信する。 00029 # データ送出を待つコンシューマを、送出する側と同じスレッドで動作させる。 00030 # 00031 # @else 00032 # @class PublisherFlush 00033 # @brief PublisherFlush class 00034 # @endif 00035 class PublisherFlush(OpenRTM.PublisherBase): 00036 """ 00037 """ 00038 00039 00040 00041 ## 00042 # @if jp 00043 # @brief コンストラクタ 00044 # 00045 # コンストラクタ 00046 # 00047 # @param self 00048 # @param consumer データ送出を待つコンシューマ 00049 # @param property 本Publisherの駆動制御情報を設定したPropertyオブジェクト 00050 # 00051 # @else 00052 # @brief Constructor 00053 # @endif 00054 def __init__(self, consumer, property): 00055 self._consumer = consumer 00056 00057 00058 ## 00059 # @if jp 00060 # @brief デストラクタ 00061 # 00062 # デストラクタ 00063 # 当該Publisherを破棄する際に、PublisherFactoryにより呼び出される。 00064 # 00065 # @param self 00066 # 00067 # @else 00068 # @brief Destructor 00069 # @endif 00070 def __del__(self): 00071 del self._consumer 00072 00073 00074 ## 00075 # @if jp 00076 # @brief Observer関数 00077 # 00078 # 送出タイミング時に呼び出す。 00079 # 即座に同一スレッドにてコンシューマの送出処理が呼び出される。 00080 # 00081 # @param self 00082 # 00083 # @else 00084 # @brief Observer function 00085 # @endif 00086 def update(self): 00087 self._consumer.push() 00088 return 00089