Port

Abstract class for creating ports

This is an abstract class and cannot be directly instanced.


[ libohymos | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

DESCRIPTION

Class Summary

class Port : public Object
{

public:
char* Data_pack_type(void) ;
Boolean Set_sender(void* s);
Boolean Register_receiver(void* r);
Boolean Switch(void);
Boolean Are_you_ready(void) ;
void Creq(void) ;
void Set_data_pack_array(void) ;
Boolean Can_you_get_data(time_t t_from, time_t t_to) ;
Boolean Can_you_get_data(time_t t) ;
void Get_data_pack_array(void**& dp_array, int& num_of_dp) ;
time_t Oldest_data_time(void) ;
time_t Newest_data_time(void) ;
int Number_of_data_packs(void) ;
Boolean Get_data_pack( void*& former, time_t data_time, void*& later, char flag) ;
Boolean Get_data_pack(void*& former, time_t data_time) ;
Boolean Get_data_pack(time_t data_time, void*& later) ;
time_t Necessary_time_from(void) ;
time_t Necessary_time_to(void) ;
void Reduce_data_pack_stock(void) ;
void Cprint(FILE* fp_out, char* head);
void Print_connection(FILE* fp_out, char* head);
void Print_connection(FILE*) ;
void Print_connection(char* head ) ;
Port* NewPort(); // pure virtual
Boolean Init(char* p_name, int p_num) ;
Port(char* p_name, int p_num);
Port(void);
~Port(void);
protected:
}; // Port

Back to the top of Port


DESCRIPTION

Port is the base class from which all port classes are derived.

クラス Port は、全ての端子モデルの基底クラスです。端子が持つべき基本 的な関数を仮想関数として宣言しています。仮想関数の一部は、このクラス では、定義を与えず、純粋仮想関数になっています。

Back to the top of Port


char* Data_pack_type(void) ;

Pure virtual function. Returns data_pack_type.

扱うデータパック型を表す文字列を返す

純粋仮想関数です. Port の派生クラスで, 扱うデータパック型を表す文 字列へのポインタを返すように必ず定義して下さい.

例えば受信端子モデルのクラスで, 受信データパック型が "int" の場合,

       char* Data_pack_type(void) { return "int"; }
     
のように実装します.

接続時には, 接続先の端子とこの端子とで Data_pack_type が一致する ことを確認します.

     RETURN:
       ・char*      扱うデータパックの型を表す文字列へのポインタ.
     

  virtual char* Data_pack_type(void) = NULL;

Back to the top of Port


Boolean Set_sender(void* s);

  virtual Boolean Set_sender(void* s);

Back to the top of Port


Boolean Register_receiver(void* r);

  virtual Boolean Register_receiver(void* r);

Back to the top of Port


Boolean Switch(void);

  virtual Boolean Switch(void);

Back to the top of Port


Boolean Are_you_ready(void) ;

計算作業前の確認

接続作業後, 計算作業前の確認に用います.

接続作業を終了し, 計算作業に進むことができる場合 YES を返し, 接続 作業が終了していない場合 NO を返します.

     RETURN:
       ・YES   接続作業が終了している.
        ・NO    接続作業が終了していない.
     

  virtual Boolean Are_you_ready(void) = NULL;

Back to the top of Port


void Creq(void) ;

Request of calculation. Transfer the request to a element which caluculate.

  virtual void Creq(void)   ;

Function is currently defined inline.


Back to the top of Port


void Set_data_pack_array(void) ;

  virtual void Set_data_pack_array(void) = NULL;

Back to the top of Port


Boolean Can_you_get_data(time_t t_from, time_t t_to) ;

取得可能データパックの確認

Can_you_get_data(time_t,time_t) は, t_from (sec) 以前から, t_to (sec) 以降までのデータパックをこの端子から取得可能ならば, YES を 返し, 不可能なら NO を返すように, 各派生クラスで定義します.

        ARGUMENT:
            ・t_from    t_from 以前からのデータパックが取得可能であること
                        を確認する.
            ・t_to      t_to 以降までのデータパックが取得可能であることを
                        確認する.
        RETURN:
            ・YES       t_from 以前から t_to 以降までのデータパックを取得
                        可能な場合.
                        t におけるデータが取得可能な場合.
            ・NO        t_from 以前から t_to 以降までのデータパックを取得
                        不可能な場合.
     

  virtual Boolean Can_you_get_data(time_t t_from, time_t t_to) = NULL;

Back to the top of Port


Boolean Can_you_get_data(time_t t) ;

Can_you_get_data(time_t) は, t におけるデータが取得可能か確認する関 数です.

  Boolean Can_you_get_data(time_t t)                                   
;

Function is currently defined inline.


Back to the top of Port


void Get_data_pack_array(void**& dp_array, int& num_of_dp) ;

  virtual void Get_data_pack_array(void**& dp_array, int& num_of_dp)
                    = NULL;

Back to the top of Port


time_t Oldest_data_time(void) ;

  virtual time_t Oldest_data_time(void) = NULL;

Back to the top of Port


time_t Newest_data_time(void) ;

  virtual time_t Newest_data_time(void) = NULL;

Back to the top of Port


int Number_of_data_packs(void) ;

  virtual int Number_of_data_packs(void) = NULL;

Back to the top of Port


Boolean Get_data_pack( void*& former, time_t data_time, void*& later, char flag) ;

  virtual Boolean Get_data_pack(
                        void*& former, time_t data_time, void*& later,
                        char flag) = NULL;

Back to the top of Port


Boolean Get_data_pack(void*& former, time_t data_time) ;

  Boolean Get_data_pack(void*& former, time_t data_time)
                                                                                       
;

Function is currently defined inline.


Back to the top of Port


Boolean Get_data_pack(time_t data_time, void*& later) ;

  Boolean Get_data_pack(time_t data_time, void*& later)
                                                                                      
;

Function is currently defined inline.


Back to the top of Port


time_t Necessary_time_from(void) ;

  virtual time_t Necessary_time_from(void) = NULL;

Back to the top of Port


time_t Necessary_time_to(void) ;

  virtual time_t Necessary_time_to(void) = NULL;

Back to the top of Port


void Reduce_data_pack_stock(void) ;

不要データパックの消去

この端子で取得可能なデータパックのうち, Necessary_time_from より データ記録時刻が早いデータパックを消去するよう, 派生クラスで定義 します.

  virtual void Reduce_data_pack_stock(void) = NULL;

Back to the top of Port


void Cprint(FILE* fp_out, char* head);

オブジェクト情報の出力

Port::Cprint では, クラス名, 扱うデ−タパックの型名, 端子名, 端子 番号をファイル fp_out に下記の通り出力します.

       fprintf(fp_out,
         "%s%s<%s> %s %d \n",
         head,
         class_name, Data_pack_type(), object_name, object_number);
     

関数 Cprint は基底クラス Object の仮想関数なので, 派生クラスごと に変更できます.

Object::Cprint が多重定義されているため, 引数 fp_out を省略した場 合は fp_out のデフォルト値は stderr です. 引数 fp_out, head の両 者を省略した場合, デフォルト値はそれぞれ stderr, 4カラムです.

fp_out, head を省略したとき, stderr, 4カラムに設定されるよう, 多 重定義しました.

        ARGUMENT:
         ・fp_out    オブジェクト情報を出力するファイルへのポインタ.
                     デフォルト値 stderr.
         ・head      コメント文字列へのポインタ.
                     デフォルト値は4カラム.
     

  void Cprint(FILE* fp_out, char* head);

Back to the top of Port


void Print_connection(FILE* fp_out, char* head);

  virtual void Print_connection(FILE* fp_out, char* head);

Back to the top of Port


void Print_connection(FILE*) ;

  void Print_connection(FILE*)
                                             
;

Function is currently defined inline.


Back to the top of Port


void Print_connection(char* head ) ;

  void Print_connection(char* head = "    ")
                                           
;

Function is currently defined inline.


Back to the top of Port


Port* NewPort();

Returns a new pointer to a new Port

  virtual Port* NewPort();    

Back to the top of 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 Port


Port(char* p_name, int p_num);

  Port(char* p_name, int p_num);

Back to the top of Port


Port(void);

  Port(void);

Back to the top of Port


~Port(void);

  ~Port(void);

Back to the top of Port


All Members

public:
char* Class_name(void) ;
char* Object_name(void) ;
int Object_number(void) ;
void* Owner(void) ;
Boolean Compare(char* c_name, char* o_name, int o_num);
Boolean Compare(char* o_name, int o_num);
Boolean Compare(Object* obj);
Boolean Set_owner(void* o);
void Cprint(FILE* fp_out, char* head);
void Cprint(FILE* fp_out) ;
void Cprint(char* head ) ;
void Oprint(FILE* fp_out, char* head);
void Oprint(FILE* fp_out) ;
void Oprint(char* head ) ;
void Absname( char* absname );
Boolean Init(char* o_name, int o_num);
char* Data_pack_type(void) ;
Boolean Set_sender(void* s);
Boolean Register_receiver(void* r);
Boolean Switch(void);
Boolean Are_you_ready(void) ;
void Creq(void) ;
void Set_data_pack_array(void) ;
Boolean Can_you_get_data(time_t t_from, time_t t_to) ;
Boolean Can_you_get_data(time_t t) ;
void Get_data_pack_array(void**& dp_array, int& num_of_dp) ;
time_t Oldest_data_time(void) ;
time_t Newest_data_time(void) ;
int Number_of_data_packs(void) ;
Boolean Get_data_pack( void*& former, time_t data_time, void*& later, char flag) ;
Boolean Get_data_pack(void*& former, time_t data_time) ;
Boolean Get_data_pack(time_t data_time, void*& later) ;
time_t Necessary_time_from(void) ;
time_t Necessary_time_to(void) ;
void Reduce_data_pack_stock(void) ;
void Print_connection(FILE* fp_out, char* head);
void Print_connection(FILE*) ;
void Print_connection(char* head ) ;
Port* NewPort(); // pure virtual
Boolean Init(char* p_name, int p_num) ;
protected:
char* class_name;
char* object_name;
int object_number;
void* owner;

Back to the top of Port


Ancestors

Inheritance chain for Port:

Back to the top of Port


Descendants

Back to the top of Port


Generated from source by the Cocoon utilities on Sun Sep 3 22:52:05 2000 .

Report problems to jkotula@stratasys.com