SSM
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

SSMApiBase Class Reference

#include <ssm.hpp>

Inheritance diagram for SSMApiBase:
SSMApi< T, P > SSMPApi< T, P >

Public Member Functions

 SSMApiBase ()
 SSMApiBase (const char *streamName, int streamId=0)
 コンストラクタ
bool isOpen () const
 開いているかどうかを返す
bool isUpdate ()
 更新されたかどうかを返す
void setVerbose (bool verbose)
 エラーメッセージを出力するかどうか
void setBlocking (bool isBlocking)
 ブロッキングするかどうか
const char * getStreamName () const
 get ssm stream name.
const char * getSensorName () const
int getStreamId () const
 get ssm stream id.
int getSensorId () const
SSM_sid getSSMId () const
 get ssm id.
void * data ()
size_t dataSize ()
void * property ()
size_t propertySize ()
virtual size_t sharedSize ()
 共有メモリに確保するデータ構造体のサイズ
bool create (double saveTime, double cycle)
 ストリームの作成
bool create (const char *streamName, int streamId, double saveTime, double cycle)
bool release ()
 ストリームの破棄
bool open (SSM_open_mode openMode=SSM_READ)
bool open (const char *streamName, int streamId=0, SSM_open_mode openMode=SSM_READ)
 ストリームを開く
bool openWait (ssmTimeT timeOut=0.0, SSM_open_mode openMode=SSM_READ)
 開くまで待つ
bool openWait (const char *streamName, int streamId=0, ssmTimeT timeOut=0.0, SSM_open_mode openMode=SSM_READ)
bool close ()
 ssmに書き込み読み込みをできなくする
virtual bool write (ssmTimeT time=gettimeSSM())
 timeを指定して書き込み
virtual bool read (SSM_tid timeId=-1)
 tidを指定して読み込み
bool readNext (int dt=1)
 前回読み込んだデータの次のデータを読み込む
bool readBack (int dt=1)
 前回のデータの1つ前のデータを読み込む
bool readLast ()
 最新データの読み込み
bool readNew ()
 新しいデータの読み込み
bool readTime (ssmTimeT time)
 時間指定読み込み
bool setProperty ()
 プロパティの設定
bool getProperty ()
 プロパティの取得
void setBuffer (void *data, size_t dataSize, void *property, size_t propertySize)
 バッファの設定

Data Fields

SSM_tid timeId
 データのTimeID
ssmTimeT time
 データのタイムスタンプ

Protected Member Functions

void init ()
 初期化
void init (const char *streamName, int streamId=0)
 名前の設定
void setStream (const char *streamName, int streamId=0)
 接続するSSMストリームの設定

Protected Attributes

const char * streamName
 ストリームの名前
int streamId
 同一ストリーム名を区別するための番号
SSM_sid ssmId
 SSM管理ID.
bool isVerbose
 エラーメッセージを出力するかどうか
bool isBlocking
 ブロッキングするかどうか
void * mData
 データのポインタ
size_t mDataSize
 データ構造体のサイズ
void * mProperty
 プロパティのポインタ
size_t mPropertySize
 プロパティサイズ

Detailed Description

SSMを簡単に扱うためのクラス

これ単体では使用しづらいので、継承して使う


Constructor & Destructor Documentation

SSMApiBase::SSMApiBase ( ) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

SSMApiBase::SSMApiBase ( const char *  streamName,
int  streamId = 0 
) [inline]

コンストラクタ

Parameters:
[in]streamNameストリーム名
[in]streamIdストリームの番号

Member Function Documentation

bool SSMApiBase::close ( ) [inline]

ssmに書き込み読み込みをできなくする

See also:
closeSSM
bool SSMApiBase::create ( const char *  streamName,
int  streamId,
double  saveTime,
double  cycle 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also:
create
bool SSMApiBase::create ( double  saveTime,
double  cycle 
) [inline]

ストリームの作成

create()したら、終了時に destroy() すること。

See also:
createSSM, destroy, open
bool SSMApiBase::getProperty ( ) [inline]

プロパティの取得

Returns:
読み込めたときtrueを返す
See also:
get_propertySSM, setProperty
bool SSMApiBase::open ( SSM_open_mode  openMode = SSM_READ) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

See also:
open
bool SSMApiBase::open ( const char *  streamName,
int  streamId = 0,
SSM_open_mode  openMode = SSM_READ 
) [inline]

ストリームを開く

Parameters:
[in]streamNameストリーム名
[in]streamIdストリームの番号
[in]openModeストリームのオープンモード選択フラグ

open() したら必ず close() すること!

open() では、read,writeのフラグを設定する。

See also:
openSSM, openWait
bool SSMApiBase::openWait ( ssmTimeT  timeOut = 0.0,
SSM_open_mode  openMode = SSM_READ 
) [inline]

開くまで待つ

Parameters:
[in]timeOut(sec)タイムアウトの時間。0以下だとタイムアウトしない
See also:
open
bool SSMApiBase::openWait ( const char *  streamName,
int  streamId = 0,
ssmTimeT  timeOut = 0.0,
SSM_open_mode  openMode = SSM_READ 
) [inline]

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

virtual bool SSMApiBase::read ( SSM_tid  timeId = -1) [inline, virtual]

tidを指定して読み込み

Returns:
正しく読み込めたときtrueを返す
See also:
readSSM, readTime

Reimplemented in SSMPApi< T, P >.

bool SSMApiBase::readBack ( int  dt = 1) [inline]

前回のデータの1つ前のデータを読み込む

Parameters:
[in]dt戻る量(正の値)
Returns:
次データを読み込めたときtrueを返す
See also:
read, readNext, readNew, readLast, readTime
bool SSMApiBase::readLast ( ) [inline]

最新データの読み込み

Returns:
正しく読み込めたときtrueを返す
See also:
read, readNew, readNex,t readBack, readTime
bool SSMApiBase::readNew ( ) [inline]

新しいデータの読み込み

Returns:
最新であり前回と違うときtrueを返す。
See also:
read, readLast, readNext, readBack, readTime
bool SSMApiBase::readNext ( int  dt = 1) [inline]

前回読み込んだデータの次のデータを読み込む

Parameters:
[in]dt進む量
Returns:
次データを読み込めたときtrueを返す

指定するデータがSSMの保存しているデータよりも古いとき、 保存されている中で最も古いデータを読み込む

See also:
read, readBack, readNew, readLast, readTime
bool SSMApiBase::readTime ( ssmTimeT  time) [inline]

時間指定読み込み

Returns:
正しく読み込めたときtrueを返す
See also:
readSSM_time, read
bool SSMApiBase::release ( ) [inline]

ストリームの破棄

See also:
releaseSSM, create
void SSMApiBase::setBlocking ( bool  isBlocking) [inline]

ブロッキングするかどうか

ブロッキングは使用が変更される可能性があるので、使用は上級者向け。 これを設定すると、readNew及びreadNextがブロッキングされる

void SSMApiBase::setBuffer ( void *  data,
size_t  dataSize,
void *  property,
size_t  propertySize 
) [inline]

バッファの設定

継承したときなど、ポインタを外部からさわらせたくないときはprivateの中に入れる

Reimplemented in SSMApi< T, P >.

bool SSMApiBase::setProperty ( ) [inline]

プロパティの設定

Returns:
書き込めたときtrueを返す
See also:
set_propertySSM, getProperty
void SSMApiBase::setStream ( const char *  streamName,
int  streamId = 0 
) [inline, protected]

接続するSSMストリームの設定

Parameters:
[in]streamNameストリーム名
[in]streamIdストリームの番号
virtual bool SSMApiBase::write ( ssmTimeT  time = gettimeSSM(  )) [inline, virtual]

timeを指定して書き込み

Parameters:
[in]time時間。指定しないときは現在時刻を書き込み
Returns:
正しく書き込めたときtrueを返す
See also:
writeSSM_time, read

Reimplemented in SSMPApi< T, P >.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines