jp.go.aist.rtm.RTC.port.publisher
クラス PublisherPeriodic

java.lang.Object
  上位を拡張 jp.go.aist.rtm.RTC.port.publisher.PublisherBase
      上位を拡張 jp.go.aist.rtm.RTC.port.publisher.PublisherPeriodic
すべての実装されたインタフェース:
java.lang.Runnable, ObjectCreator<PublisherBase>, ObjectDestructor

public class PublisherPeriodic
extends PublisherBase
implements java.lang.Runnable, ObjectCreator<PublisherBase>, ObjectDestructor

一定時間おきにコンシューマの送出処理を呼び出すPublisherです。


入れ子のクラスの概要
protected static class PublisherPeriodic.Policy
           
 
フィールドの概要
protected  Logbuf rtcout
          
 
コンストラクタの概要
PublisherPeriodic()
           Constructor
 
メソッドの概要
 ReturnCode activate()
           activate
protected  ReturnCode convertReturn(ReturnCode status, org.omg.CORBA.portable.OutputStream data)
           convertReturn
protected  boolean createTask(Properties prop)
           Setting Task
 PublisherBase creator_()
           creator_
 ReturnCode deactivate()
           deactivate
 void destructor_(java.lang.Object obj)
           destructor_
 java.lang.String getName()
           getName
 ReturnCode init(Properties prop)
           Initialization
protected  ReturnCode invokeListener(ReturnCode status, org.omg.CORBA.portable.OutputStream data)
           
 boolean isActive()
           write
protected  void onBufferEmpty()
           Connector listener functions
protected  void onBufferFull(org.omg.CORBA.portable.OutputStream data)
           
protected  void onBufferRead(org.omg.CORBA.portable.OutputStream data)
           
protected  void onBufferWrite(org.omg.CORBA.portable.OutputStream data)
           Connector data listener functions
protected  void onBufferWriteTimeout(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceived(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceiverError(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceiverFull(org.omg.CORBA.portable.OutputStream data)
           
protected  void onReceiverTimeout(org.omg.CORBA.portable.OutputStream data)
           
protected  void onSend(org.omg.CORBA.portable.OutputStream data)
           
protected  void onSenderEmpty()
           
protected  void onSenderError()
           
 int open()
          当該Publisherの駆動を開始します。
static void PublisherPeriodicInit()
           PublisherPeriodicInit
protected  ReturnCode pushAll()
           pushAll
protected  ReturnCode pushFifo()
           pushFifo
protected  ReturnCode pushNew()
           pushNew
protected  ReturnCode pushSkip()
           pushSkip
 void release()
          駆動フラグがオフとなり、Publisherの駆動が停止します。
 void run()
          当該Publisherを駆動するスレッドコンテキストです。コンシューマの送出処理が呼び出されます。
 ReturnCode setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)
           setBuffer
 ReturnCode setConsumer(InPortConsumer consumer)
           setConsumer
 ReturnCode setListener(ConnectorBase.ConnectorInfo info, ConnectorListeners listeners)
          Setting buffer pointer
protected  void setPushPolicy(Properties prop)
           Setting PushPolicy
 int svc()
          当該Publisherを駆動するスレッドコンテキストです。コンシューマの送出処理が呼び出されます。
 void update()
          本Publisher実装では、何も行いません。
 ReturnCode write(org.omg.CORBA.portable.OutputStream data)
           
 ReturnCode write(org.omg.CORBA.portable.OutputStream data, int sec, int usec)
           Write data
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

rtcout

protected Logbuf rtcout

コンストラクタの詳細

PublisherPeriodic

public PublisherPeriodic()
Constructor

メソッドの詳細

update

public void update()

本Publisher実装では、何も行いません。


svc

public int svc()

当該Publisherを駆動するスレッドコンテキストです。コンシューマの送出処理が呼び出されます。


pushAll

protected ReturnCode pushAll()

pushAll

push all policy

戻り値:
ReturnCode

pushFifo

protected ReturnCode pushFifo()

pushFifo

push "fifo" policy

戻り値:
ReturnCode

pushSkip

protected ReturnCode pushSkip()

pushSkip

push "skip" policy

戻り値:
ReturnCode

pushNew

protected ReturnCode pushNew()

pushNew

push "new" policy

戻り値:
ReturnCode

run

public void run()

当該Publisherを駆動するスレッドコンテキストです。コンシューマの送出処理が呼び出されます。

定義:
インタフェース java.lang.Runnable 内の run

open

public int open()

当該Publisherの駆動を開始します。


release

public void release()

駆動フラグがオフとなり、Publisherの駆動が停止します。

ただし、最大1回のみコンシューマの送出処理が呼び出されることがあります。

オーバーライド:
クラス PublisherBase 内の release

init

public ReturnCode init(Properties prop)
Initialization

This function have to be called before using this class object. Properties object that includes certain configuration information should be given as an argument. At least, a numerical value of unit of Hz with the key of "dataport.publisher.push_rate" has to be set to the Properties object of argument. The value is the invocation cycle of data sending process. In case of 5 ms period or 200 Hz, the value should be set as 200.0. False will be returned, if there is no value with the key of "dataport.publisher.push_rate". The following options are available.

定義:
クラス PublisherBase 内の init
パラメータ:
prop - Property objects that includes the control information of this Publisher
戻り値:
PORT_OK normal return INVALID_ARGS Properties with invalid values.

setPushPolicy

protected void setPushPolicy(Properties prop)

Setting PushPolicy


createTask

protected boolean createTask(Properties prop)

Setting Task


setConsumer

public ReturnCode setConsumer(InPortConsumer consumer)

setConsumer

Store InPort consumer

定義:
クラス PublisherBase 内の setConsumer
パラメータ:
consumer -
戻り値:
ReturnCode

setBuffer

public ReturnCode setBuffer(BufferBase<org.omg.CORBA.portable.OutputStream> buffer)

setBuffer

Setting buffer

定義:
クラス PublisherBase 内の setBuffer
パラメータ:
buffer -
戻り値:
ReturnCode

setListener

public ReturnCode setListener(ConnectorBase.ConnectorInfo info,
                              ConnectorListeners listeners)
Setting buffer pointer

定義:
クラス PublisherBase 内の setListener
戻り値:
ReturnCode

write

public ReturnCode write(org.omg.CORBA.portable.OutputStream data,
                        int sec,
                        int usec)
Write data

This function writes data into the buffer associated with this Publisher. If a Publisher object calls this function, without initializing correctly such as a consumer, a buffer, listeners, etc., error code PRECONDITION_NOT_MET will be returned and no operation of the writing to a buffer etc. will be performed. Since writing into the buffer and sending data to InPort are performed asynchronously, occasionally this function returns return-codes such as CONNECTION_LOST and BUFFER_FULL that indicate the result of sending data to InPort. In this case, writing data into buffer will not be performed. When publisher writes data to the buffer, if the buffer is filled, returns error, is returned with timeout and returns precondition error, error codes BUFFER_FULL, BUFFER_ERROR, BUFFER_TIMEOUT and PRECONDITION_NOT_MET will be returned respectively. In other cases, PROT_ERROR will be returned.

定義:
クラス PublisherBase 内の write
パラメータ:
data - Data to be wrote to the buffer
sec - Timeout time in unit seconds
usec - Timeout time in unit micro-seconds
戻り値:
PORT_OK Normal return PRECONDITION_NO_MET Precondition does not met. A consumer, a buffer, listenes are not set properly. CONNECTION_LOST detected that the connection has been lost BUFFER_FULL The buffer is full status. BUFFER_ERROR Some kind of error occurred in the buffer. NOT_SUPPORTED Some kind of operation that is not supported has been performed. TIMEOUT Timeout occurred when writing to the buffer.

write

public ReturnCode write(org.omg.CORBA.portable.OutputStream data)
定義:
クラス PublisherBase 内の write

isActive

public boolean isActive()

write

定義:
クラス PublisherBase 内の isActive
戻り値:
boolean

activate

public ReturnCode activate()

activate

定義:
クラス PublisherBase 内の activate
戻り値:
ReturnCode

deactivate

public ReturnCode deactivate()

deactivate

定義:
クラス PublisherBase 内の deactivate
戻り値:
ReturnCode

creator_

public PublisherBase creator_()

creator_

定義:
インタフェース ObjectCreator<PublisherBase> 内の creator_
戻り値:
Object Created instances

destructor_

public void destructor_(java.lang.Object obj)

destructor_

定義:
インタフェース ObjectDestructor 内の destructor_
パラメータ:
obj - The target instances for destruction

convertReturn

protected ReturnCode convertReturn(ReturnCode status,
                                   org.omg.CORBA.portable.OutputStream data)

convertReturn


invokeListener

protected ReturnCode invokeListener(ReturnCode status,
                                    org.omg.CORBA.portable.OutputStream data)

PublisherPeriodicInit

public static void PublisherPeriodicInit()

PublisherPeriodicInit


getName

public java.lang.String getName()

getName

定義:
クラス PublisherBase 内の getName
戻り値:
String

onBufferWrite

protected void onBufferWrite(org.omg.CORBA.portable.OutputStream data)

Connector data listener functions


onBufferFull

protected void onBufferFull(org.omg.CORBA.portable.OutputStream data)

onBufferWriteTimeout

protected void onBufferWriteTimeout(org.omg.CORBA.portable.OutputStream data)

onBufferRead

protected void onBufferRead(org.omg.CORBA.portable.OutputStream data)

onSend

protected void onSend(org.omg.CORBA.portable.OutputStream data)

onReceived

protected void onReceived(org.omg.CORBA.portable.OutputStream data)

onReceiverFull

protected void onReceiverFull(org.omg.CORBA.portable.OutputStream data)

onReceiverTimeout

protected void onReceiverTimeout(org.omg.CORBA.portable.OutputStream data)

onReceiverError

protected void onReceiverError(org.omg.CORBA.portable.OutputStream data)

onBufferEmpty

protected void onBufferEmpty()

Connector listener functions


onSenderEmpty

protected void onSenderEmpty()

onSenderError

protected void onSenderError()