Receive_port

Class for models of receive ports.

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

Quick Index

DESCRIPTION

Class Summary

class Receive_port : public Port
{

public:
char* Data_pack_type(void) ;
Boolean Set_sender(void* s);
Boolean Switch(void) ;
Boolean Are_you_ready(void) ;
void Set_data_pack_array(void) ;
time_t Oldest_data_time(void) ;
time_t Newest_data_time(void) ;
int Number_of_data_packs(void) ;
Boolean Can_you_get_data(time_t t_from, time_t t_to) ;
Boolean Can_you_get_data(time_t t_fromto) ;
void Get_data_pack_array(void**& dp_array, int& num_of_dp) ;
Boolean Get_data_pack(void*& former, time_t data_time, void*& later, char flag ) ;
time_t Necessary_time_from(void);
time_t Necessary_time_to(void);
void Creq(void) ;
void Reduce_data_pack_stock(void) ;
void Print_connection(FILE* fp_outr, char* head);
Boolean Init(char* p_name, int p_num) ;
Receive_port(char* p_name, int p_num);
Receive_port(void);
~Receive_port(void);
protected:
void* sender;
}; // Receive_port

Back to the top of Receive_port


DESCRIPTION

Class for models of receive ports. Derived from the class Port.

The class Receive_port has a member for storing the pointer to a sender which sends datapacks to the current receive port.

Member functions for

are defined.

NOTE:

Only one send port can be connected to an object of class Receive_port.

基本型受信端子モデル \verb|Receive_port| を作成します。受信端子には 送信元端子を一つだけつなぐことができます。

クラス Receive_port では,

        ・データパック送信元端子    : sender
    
を記憶し, ・送信元端子との接続機能 ・sender からのデータパック受信機能 を定義しました.

Receive_port に接続できる送信元端子は一つだけです.

Back to the top of Receive_port


void* sender;

Pointer to a sender which sends datapacks to the current object void* 型にキャストされた送信元端子のアドレス

  void* sender;

Back to the top of Receive_port


char* Data_pack_type(void) ;

Returns a string which expresses the type of datapacks received by the current object. This is a pure virtual function. This function must be defined in derived classes. 受信データパック型を表す文字列を返す

基底クラス Port の純粋仮想関数です. Receive_port でも純粋仮想関数としておきます. Receive_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 Receive_port


Boolean Set_sender(void* s);

Virtual function declared in the base class Port. Set "sender" to "s" and return YES.

When one of the following cases occurs

this function prints an error message and returns NO.

送信元端子の設定

基底クラス Port の純粋仮想関数です. 送信元端子 sender を s に設定し, YES を返します.

下記の場合はエラーメッセージを表示し, NO を返します.

      ・s が NULL の場合.
      ・この端子の送信元端子 sender が設定済みの場合.
      ・この端子と s で, Data_pack_type が異なる場合.
     
     ARGUMENT:
       ・s     void* 型にキャストされた送信元端子のアドレス.
     RETURN:
       ・YES   送信元端子 sender が正常に設定された場合.
       ・NO    s が NULL の場合.
               この端子の送信元端子 sender が設定済みの場合.
               この端子と s で, Data_pack_type が異なる場合.
     ACCIDENT:
       ・s に Port* 型変数が格納されていない場合.
     

  Boolean Set_sender(void* s);

Back to the top of Receive_port


Boolean Switch(void) ;

Virtual function declared in the base class Port. Because no corresponding work is needed in the Receive_port class, Switch of the Receive_port class simply returns YES.

Note: Switch of the Sender_port class is defined differently.

接続作業後の処理

基底クラス Port の仮想関数です. Receive_port では, 接続作業後行うべき処理は特にありません. 常に YES を返します.

          RETURN:
            ・YES   常に YES を返す.
     

  Boolean Switch(void)                
;

Function is currently defined inline.


Back to the top of Receive_port


Boolean Are_you_ready(void) ;

Answers whether the current receive port has been connected to some sender or not.

計算作業前の確認

基底クラス Port の純粋仮想関数です. データパックを受信可能な状態であることを確認します. sender が設定されていれば, sender からデータパックを受信できます.

     RETURN:
     ・YES   sender が設定済みの場合.
     ・NO    sender が未設定の場合.
     

  Boolean Are_you_ready(void)                                 ;

Function is currently defined inline.


Back to the top of Receive_port


void Set_data_pack_array(void) ;

Orders the sender to create a data_pack_array.

デ−タパック配列の作成

基底クラス Port の純粋仮想関数です. sender にデータパック配列を作成するよう命令します.

  void Set_data_pack_array(void)
                                                    
;

Function is currently defined inline.


Back to the top of Receive_port


time_t Oldest_data_time(void) ;

Returns the data time of the oldest data pack in the data stored in the sender.

  time_t Oldest_data_time(void)
                                                        
;

Function is currently defined inline.


Back to the top of Receive_port


time_t Newest_data_time(void) ;

Returns the data time of the newest data pack in the data stored in the sender.

    time_t Newest_data_time(void)
                                                        
;

Function is currently defined inline.


Back to the top of Receive_port


int Number_of_data_packs(void) ;

Returns the number of datapacks stored in the sender.

  int Number_of_data_packs(void)
                                                        
;

Function is currently defined inline.


Back to the top of Receive_port


Boolean Can_you_get_data(time_t t_from, time_t t_to) ;

Tells whether the data from "t_from" to "t_to" can be obtained or not

  Boolean Can_you_get_data(time_t t_from, time_t t_to)
                                                                    
;

Function is currently defined inline.


Back to the top of Receive_port


Boolean Can_you_get_data(time_t t_fromto) ;

Tells whether the data at "t_fromto" can be obtained or not

  Boolean Can_you_get_data(time_t t_fromto)
                                                                          
;

Function is currently defined inline.


Back to the top of Receive_port


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

Get a data pack array from the sender. After the execution of this function, "dp_array" stores the data pack array and "num_of_dp" stores the dimention of "dp_array".

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

Function is currently defined inline.


Back to the top of Receive_port


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

Get a data pack at specified time "data_time". The results are stored in "former" and "later".

When a data pack just at "data_time" exists, "former" and "later" point to that data pack.

"flag" specifies the search option.

'b'
Receive both of "former" and "later"

'f'
Receive "former". Even if "later" cannot be obtained, the function returns YES.

'l'
Receive "later". Even if "former" cannot be obtained, the function returns YES.

other character
Receive at lease one of "former" and "later"

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

Function is currently defined inline.


Back to the top of Receive_port


time_t Necessary_time_from(void);

Returns the "Necessary_time_from(this)" of the owner of the current receive port. Because this function is virtual, you can redefine it in derived classes.

  time_t Necessary_time_from(void);

Back to the top of Receive_port


time_t Necessary_time_to(void);

Returns the "Necessary_time_to(this)" of the owner of the current receive port. Because this function is virtual, you can redefine it in derived classes.

  time_t Necessary_time_to(void);

Back to the top of Receive_port


void Creq(void) ;

Relay the calculation request to the sender

  void Creq(void)                             
;

Function is currently defined inline.


Back to the top of Receive_port


void Reduce_data_pack_stock(void) ;

Remove unnecessary data packs from the memory.

  void Reduce_data_pack_stock(void)
                                                       
;

Function is currently defined inline.


Back to the top of Receive_port


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

Print the information about the connection to "fp_out" with the string "head"

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

Back to the top of Receive_port


Boolean Init(char* p_name, int p_num) ;

Initialization with object name "p_name" and object number "p_num"

  Boolean Init(char* p_name, int p_num)
                      ;

Function is currently defined inline.


Back to the top of Receive_port


Receive_port(char* p_name, int p_num);

Constructor. Sets object name to "p_name" and object number to "p_num"

  Receive_port(char* p_name, int p_num);

Back to the top of Receive_port


Receive_port(void);

Constructor.

  Receive_port(void);

Back to the top of Receive_port


~Receive_port(void);

Destructor.

  ~Receive_port(void);

Back to the top of Receive_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) ;
Boolean Can_you_get_data(time_t t_fromto) ;
Boolean Get_data_pack(void*& former, time_t data_time, void*& later, char flag ) ;
void Print_connection(FILE* fp_outr, char* head);
protected:
char* class_name;
char* object_name;
int object_number;
void* owner;
void* sender;

Back to the top of Receive_port


Ancestors

Inheritance chain for Receive_port:

Back to the top of Receive_port


Descendants

Back to the top of Receive_port


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

Report problems to jkotula@stratasys.com