[ libohymos | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
Back to the top of Send_port
Data members data_pack_array and number_of_data_packs and some member functios to store datapacks are defined.
クラス Send_port では,
・送信データパック : data_pack_array, number_of_data_packs
を記憶し,
・データパック収録, 送信機能
を定義しました.
Send_port の送信機能は, 基底クラス Sender_port で定義済みです.
Send_port には, 複数の送信先端子を接続できます.
Back to the top of Send_port
void** data_pack_array;
Pointer to an array of casted as void* of address of datapacks
void** data_pack_array; //; データパック送信用配列
Back to the top of Send_port
int number_of_data_packs;
The number of elements stored in 'data_pack_array'
int number_of_data_packs; //; data_pack_array の要素数
Back to the top of Send_port
Boolean protect_past_data_flag;
protect_past_data_flag is designed to use to control the
protect mode of past data_pack\'s. protect_past_data_flag
should be checked in the functions Reduce_data_pack_stock and
Forget_data_pack_stock.
Boolean protect_past_data_flag;
Back to the top of Send_port
char* Data_pack_type(void) ;
Returns the string which shows the type of the datapack sent by the
current port
例えば, 送信データパック型が "INT" である派生クラスでは,
接続時には, この端子と送信先端子とで Data_pack_type が一致するこ
とを確認します.
char* Data_pack_type(void) { return "INT"; }
のように定義します.
RETURN:
・char* 送信データパック型を表す文字列へのポインタ.
virtual char* Data_pack_type(void) = NULL;
Back to the top of Send_port
buffer_list を送信先受信端子登録用から送信データパック収録用に転
換します.
まず Sender_port::Switch を実行します.
ここで戻り値が NO ならば, NO を返します.
戻り値が YES なら, List 型オブジェクトを new で作成し buffer_list
に設定し, data_pack_array, number_of_data_packs を NULL, 0 に設定
し, YES を返します.
この時, List::List には, Clf_dp (datapack.h 参照) を渡します.
ここで記憶領域を確保できない場合, レベル5で強制終了します.
Boolean Switch(void);
RETURN:
・YES Send_port が正常に転換できた場合.
・NO receive_port_array が作成済みの場合.
(Sender_port::Switch)
data_pack_array が作成済みの場合.
EXIT:
・5 receive_port_array の記憶領域を確保できなかった場合.
(Sender_port::Switch)
データパック収録用 buffer_list をヒープに確保できなか
った場合. (new)
virtual Boolean Switch(void);
Back to the top of Send_port
基底クラス Sender_port の仮想関数です.
データパックを送信可能な状態であることを確認します.
receivers_array が作成済みで, データパック収録用の buffer_list が
存在すれば, データパックを収録, 送信できます.
Boolean Are_you_ready(void) ;
RETURN:
・YES sender が NULL で, データパック収録用 buffer_list が
存在する場合.
sender が設定されている場合.
・NO sender が NULL で, データパック収録用 buffer_list が
存在しない場合.
virtual Boolean Are_you_ready(void) ;
Function is currently defined inline.
Back to the top of Send_port
void Creq(void) ;
Transer the calculatio request to the owner
void Creq(void) ;
Function is currently defined inline.
Back to the top of Send_port
最新の収録データパックと, d_pack のデータ記録時刻を比較し, d_pack
の方が新しければ d_pack を buffer_list に収録します.
同時刻の場合や, d_pack の方が古い場合は, d_pack を収録しません.
仮想関数なので, 例えば不連続判断が不要な場合などは, 派生クラスで
再定義して下さい.
void Stock(void* d_pack);
ARGUMENT:
・d_pack 送信するデータパックへのポインタを void* 型にキャ
ストしたもの.
EXIT:
・Level 5 buffer_list の記憶領域が確保できない場合.
(List::Put_tail)
ACCIDENT:
・buffer_list が NULL の場合.
・d_pack に Data_pack* 型変数が格納されていない場合.
virtual void Stock(void* d_pack);
Back to the top of Send_port
void Send_by_string(char*& dstr) ;
virtual void Send_by_string(char*& dstr) = NULL;
Back to the top of Send_port
基底クラス Sender_port の純粋仮想関数です.
data_pack_array を一度消去して, 再び作成します.
data_pack_array の内容を buffer_list に合わせて更新します.
data_pack_array は, 未作成のとき NULL を指すようにしています.
void Set_data_pack_array(void) ;
EXIT:
・Level 5 List::List_to_array で dat_pack_array の記憶領域
を確保できなかった場合.
virtual void Set_data_pack_array(void) ;
Function is currently defined inline.
Back to the top of Send_port
time_t Oldest_data_time(void);
virtual time_t Oldest_data_time(void);
Back to the top of Send_port
time_t Newest_data_time(void);
virtual time_t Newest_data_time(void);
Back to the top of Send_port
int Number_of_data_packs(void);
virtual int Number_of_data_packs(void);
Back to the top of Send_port
t_from 以前から t_to 以降までのデータパックが, が収録されている場
合 YES を返し, 収録されていない場合 NO を返します.
まず, data_pack_array に収録されている場合 YES を返します.
収録されていない場合は, 更に buffer_list に収録されているか調べ,
buffer_list に収録されていれば, data_pack_array を更新して YES を
返します.
収録されていない場合 NO を返します.
Boolean Can_you_get_data(time_t t_from, time_t t_to);
ARGUMENT:
・t_from t_from 以前からデータパックが収録されていることを
確認する.
・t_to t_to 以降までデータパックが収録されていることを確
認する.
RETURN:
・YES t_from 以前から t_to 以降までのデータパックが収録
されている場合.
・NO t_from 以前から t_to 以降までのデータパックが収録
されていない場合.
virtual Boolean Can_you_get_data(time_t t_from, time_t t_to);
Back to the top of Send_port
基底クラス Sender_port の純粋仮想関数です.
参照引数に, データメンバ data_pack_array, number_of_data_packs を
格納します.
void Get_data_pack_array(void**& dp_array, int& num_of_dp) ;
ARGUMENT:
・dp_array data_pack_array を格納する参照引数.
・num_of_dp number_of_data_packs を格納する参照引数.
virtual void Get_data_pack_array(void**& dp_array, int& num_of_dp) ;
Function is currently defined inline.
Back to the top of Send_port
基底クラス Sender_port の純粋仮想関数です.
sender が NULL でない場合, sender に Get_data_pack を実行させます.
この時, 引数はそのまま渡します.
sender が NULL の場合, data_pack_array を検索して以下の処理を行な
います.
former には, データ記録時刻が data_time 以前で data_time に最も近
い収録データパックへのポインタを取得, 格納します.
later には, データ記録時刻が data_time 以降で data_time に最も近
い収録データパックへのポインタを取得, 格納します.
データ記録時刻が丁度 data_time であるデータパックが収録されている
場合は, former, later ともそれを格納します.
条件を満たすデータパックを取得できない場合, former, later は NULL
に設定されます.
Boolean Get_data_pack(void*& former, time_t data_time, void*& later, char flag );
flag は取得のモードを選択するためのオプションで, 下記の通りです.
・'b' former, later の両方を必ず取得する.
取得できない場合は, 両方とも NULL に設定する.
・'f' former を必ず取得する.
later を取得できなくても, former のみ取得する.
・'l' later を必ず取得する.
former を取得できなくても, later のみ取得する.
・その他 former, later のすくなくとも一方を取得する.
flag のデフォルト値は, 'b' です.
多重定義したので, 引数に later を渡さない場合は, flag を f として
former のみ取得し, 引数に former を渡さない場合は, flag を l とし
て later のみ取得します.
ARGUMENT:
・former data_time 以前で data_time に最も近い収録デー
タパックへのポインタを格納する参照引数.
・data_time 指定時刻. (sec)
この時刻に最も近いデータ記録時刻を持つ収録デ
ータパックを取得する.
・later data_time 以降で data_time に最も近い収録デー
タパックへのポインタを格納する参照引数.
・flag データパックの取得条件を指定するフラグ.
RETURN:
・YES 指定のデータパックを取得できた場合.
・NO data_pack_array が NULL の場合.
指定のデータパックを取得できない場合.
virtual Boolean Get_data_pack(void*& former, time_t data_time, void*& later, char flag = 'b');
Back to the top of Send_port
基底クラス Sender_port の純粋仮想関数です.
Neccesary_time_from より前の収録データパックを buffer_list から削
除, 消去し, data_pack_array, number_of_data_packs を更新します.
void Reduce_data_pack_stock(void);
virtual void Reduce_data_pack_stock(void);
Back to the top of Send_port
void Forget_data_pack_stock(time_t t_from);
Delete past data_pack before t_from from buffer_list and renew
data_pack_array and number_of_data_packs.
virtual void Forget_data_pack_stock(time_t t_from);
Back to the top of Send_port
Boolean Set_protect_past_data_flag(Boolean pflag) ;
Boolean Set_protect_past_data_flag(Boolean pflag) ;
Function is currently defined inline.
Back to the top of Send_port
void Clear_data_pack(void);
Back to the top of Send_port
void Save_send_port_stock(FILE* fp);
virtual void Save_send_port_stock(FILE* fp);
Back to the top of Send_port
Boolean Init(char* p_name, int p_num) ;
Boolean Init(char* p_name, int p_num) ;
Function is currently defined inline.
Back to the top of Send_port
Send_port(char* p_name, int p_num);
Send_port(char* p_name, int p_num);
Back to the top of Send_port
Send_port(void);
Back to the top of Send_port
~Send_port(void);
Back to the top of Send_port
Back to the top of Send_port
Back to the top of Send_port
Back to the top of Send_port
Report problems to jkotula@stratasys.com