Relay_port


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

Quick Index

DESCRIPTION

Class Summary

class Relay_port : public Sender_port
{

public:
char* Data_pack_type(void) ;
Boolean Set_sender(void* s);
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) ;
void Creq(void) ;
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 ) ;
void Reduce_data_pack_stock(void) ;
void Print_connection(FILE* fp_out , char* head );
Boolean Init(char* p_name, int p_num) ;
Relay_port(char* p_name, int p_num);
Relay_port(void);
~Relay_port(void);
protected:
void* sender;
}; // Relay_port

Back to the top of Relay_port


DESCRIPTION

The Relay_port class is a model of relay ports.

The Relay_port has a data member "sender". "sender" is used to store the pointer to the sender which sends data packs to the current port.

Member functions for

are defined.

Only one port can be connected to the port for receiving data packs. More than one ports can be connected to the ports which sending data packs.

基本型中継端子モデルのクラス

クラス Relay_port では,

        ・データパック送信元端子    : sender
    
を記憶し,
        ・送信元端子との接続機能
        ・送信先端子との接続機能
    
を定義しました. 送信元端子とは,この中継端子にデータを送ってくる側の 端子です。送信先端子とは,この中継端子から送られるデータを受けとる側 の端子です。

Relay_port に接続できる送信元端子は一つだけです. Relay_port には, 複数の送信先端子を接続できます.

Back to the top of Relay_port


void* sender;

Address of the sender which sends data packs to this Relay_port casted to type void*

void* 型にキャストされた送信元端子のアドレス

  void* sender;

Back to the top of Relay_port


char* Data_pack_type(void) ;

Returns the string which shows the type of data packs which are treated by this Relay_port.

In derived classes of the class Relay_port, this funstion should be defined so that it returnts the data_pack type string. For example, for the Relay_port which treats int, define as

     char* Data_pack_type(void) { return "INT"; }
     

中継データパック型を表す文字列を返す

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


Boolean Set_sender(void* s);

Sets the sender of this Relay_port to s

in s
- address of the sender casted to void*

Returns YES if the setting was successfull. For the following cases, it returns NO.

  Boolean Set_sender(void* s);

Back to the top of Relay_port


Boolean Are_you_ready(void) ;

Reports whether this Relay_port is ready or not. When "sender" and "number_of_receivers" have been defined, it returns YES, otherwise it returns NO.

  Boolean Are_you_ready(void)
                                                                                            ;

Function is currently defined inline.


Back to the top of Relay_port


void Set_data_pack_array(void) ;

Orders the sender to create a data_pack array.

  void Set_data_pack_array(void)
                                                    
;

Function is currently defined inline.


Back to the top of Relay_port


time_t Oldest_data_time(void) ;

Returns the oldest data time of the data stocked in the sender.

  time_t Oldest_data_time(void)
                                                        
;

Function is currently defined inline.


Back to the top of Relay_port


time_t Newest_data_time(void) ;

Returns the newest data time of the data stocked in the sender.

  time_t Newest_data_time(void)
                                                        
;

Function is currently defined inline.


Back to the top of Relay_port


int Number_of_data_packs(void) ;

Returns the number of datapacks which stored in the sender

  int Number_of_data_packs(void)
                                                            
;

Function is currently defined inline.


Back to the top of Relay_port


Boolean Can_you_get_data(time_t t_from, time_t t_to) ;

Reports whether this Relay_port can get the data from t_from to t_to

in t_from
- start time
in t_to
- end time

  Boolean Can_you_get_data(time_t t_from, time_t t_to)
                                                                    
;

Function is currently defined inline.


Back to the top of Relay_port


void Creq(void) ;

中継端子への計算要請は、送信端子に転送。

  void Creq(void)                             
;

Function is currently defined inline.


Back to the top of Relay_port


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

Get datapack array dp_array and the number of datapacks num_of_fp from the sender.

out dp_array
- datapack array
out num_of_dp
- the number of datapacks

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

Function is currently defined inline.


Back to the top of Relay_port


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

Get two pointers to datapacks former and later. former is the pointer to the newest datapack before time data_time. later is the pointer to the oldest datapack after data_time. flag specifies the option

When the pointer(s) specified by flag can be got, it returns YES, otherwise NO.

out former
- pointer to a datapack
in data_time
- specified time
out later
- pointer to a datapack
in flag
- option to get pointers to datapacks

  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 Relay_port


void Reduce_data_pack_stock(void) ;

Forwards the message Reduce_data_pack_stock() to the sender

  void Reduce_data_pack_stock(void)
                                                       
;

Function is currently defined inline.


Back to the top of Relay_port


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

Prints the information about connection of this Relay_port. This function is used for debugging.

  void Print_connection(FILE* fp_out = stderr, char* head = "    ");

Back to the top of Relay_port


Boolean Init(char* p_name, int p_num) ;

Sets the object name to p_name and the object number to p_num

  Boolean Init(char* p_name, int p_num)
                      ;

Function is currently defined inline.


Back to the top of Relay_port


Relay_port(char* p_name, int p_num);

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

  Relay_port(char* p_name, int p_num);

Back to the top of Relay_port


Relay_port(void);

Constructor.

  Relay_port(void);

Back to the top of Relay_port


~Relay_port(void);

Destructor.

  ~Relay_port(void);

Back to the top of Relay_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) ;
void Set_comment_string(char* cmt);
char* Get_comment_string(void);
Boolean Get_data_pack(void*& former, time_t data_time, void*& later, char flag ) ;
void Print_connection(FILE* fp_out , char* head );
protected:
char* class_name;
char* object_name;
int object_number;
void* owner;
List* buffer_list;
void** receiver_array;
int number_of_receivers;
char* comment_string;
void* sender;

Back to the top of Relay_port


Ancestors

Inheritance chain for Relay_port:

Back to the top of Relay_port


Descendants

Back to the top of Relay_port


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

Report problems to jkotula@stratasys.com