[ Keywords | Classes | Data | Functions ]
Back to the top of libohymos
Back to the top of libohymos
Back to the top of libohymos
const char Mysdir[] = "OHYMOSSDIR";
#include "common.h"
The name of the directorys which contain the source files
Example:
% setenv OHYMOSSDIR "/work;/home/shiiba/Hymos/newhymos"
const char Mysdir[] = "OHYMOSSDIR";
Back to the top of libohymos
typedef int Boolean;
#include "common.h"
Definition of type Boolean
#define NO 0
#define YES 1
typedef int Boolean;
Back to the top of libohymos
void Print_comments( FILE* fp_out, char* src_file, int src_line, char* head );
#include "common.h"
Prints the comments written in the source file 'src_file' to the file to which the file pointer 'fp_out' points. The comment which appears first below the line with line number 'src_line' and subsequent consecutive comments are printed.
void Print_comments( FILE* fp_out, // the comments are printed into 'fp_out' char* src_file, // the comments in 'src_file' are processed int src_line, // the comments appears below line number 'src_line' // are processed. char* head = " " // 'head' is printed at the top of each line );
Back to the top of libohymos
void Eprint( char* src_file, int src_line, char* title, Boolean src_comments );
#include "common.h"
Executes
void Eprint( char* src_file, // the name of the source file int src_line, // refer the comments in Print_comments char* title, // string which shows the content of error briefly Boolean src_comments = YES );
Back to the top of libohymos
void Eprint(char* src_file, int src_line, Boolean src_comments ) ;
#include "common.h"
Executes
inline void Eprint(char* src_file, int src_line, Boolean src_comments = YES) ;
Function is currently defined inline.
Back to the top of libohymos
void Wprint(char* src_file, int src_line, char* title, Boolean src_comments );
#include "common.h"
Executes
void Wprint(char* src_file, int src_line, char* title, Boolean src_comments = YES);
Back to the top of libohymos
void Wprint(char* src_file, int src_line, Boolean src_comments ) ;
#include "common.h"
Executes
inline void Wprint(char* src_file, int src_line, Boolean src_comments = YES) ;
Function is currently defined inline.
Back to the top of libohymos
void Eprint_memory( char* src_file, int src_line, char* array_typ, int array_len, Boolean src_comments );
#include "common.h"
Prints error message showing the occurence of memory shortage and if src_comments is YES then execute
void Eprint_memory( char* src_file, // the name of the source file in which error // occured int src_line, // the line number where error occured char* array_typ, // the type name of the memory which the user // tried to acquire. ex. "int" int array_len, // the array size Boolean src_comments // whether print the comments in the source file // or not // Example // if ((string = new char[16]) == NULL) &( // Eprint_memory(__FILE__, __LINE__, "char", 16, YES); // exit(1); // // memory allocation error // &) );
Back to the top of libohymos
void Eprint_memory(char* src_file, int src_line, char* array_typ, Boolean src_comments) ;
#include "common.h"
Prints error message showing the occurence of memory shortage. Executes
inline void Eprint_memory(char* src_file, int src_line, char* array_typ, Boolean src_comments) ;
Function is currently defined inline.
Back to the top of libohymos
void Eprint_memory(char* src_file, int src_line, Boolean src_comments) ;
#include "common.h"
Prints error message showing the occurence of memory shortage. Executes
inline void Eprint_memory(char* src_file, int src_line, Boolean src_comments) ;
Function is currently defined inline.
Back to the top of libohymos
void Eprint_fopen( char* src_file, int src_line, char* fname, char* mode, Boolean src_comments );
#include "common.h"
Print a error message telling that a file cannnot be opened. If src_comments is YES, then execute
void Eprint_fopen( char* src_file, // the name of the source program file where the error // occured. int src_line, // the line number where the error occured. char* fname, // the name of the file which cannot be opened. char* mode, // the file open mode Boolean src_comments = YES // // Example // FILE *fp = fopen("abc.dat", "r"); // if (fp == NULL) &( // Eprint_fopen(__FILE__, __LINE__, "abc.dat", "r", YES); // // Cannot open the file. // &) // );
Back to the top of libohymos
char pick_char(istream& s);
#include "common.h"
Checks the status of istream 's'.
If the status is in such an error state from which it is impossible to recover, then prints error message and exits.
If the status is 'fail' state, then reset the error state to normal state, and reads in the character which caused the error state, and returns the character.
If the status is normal, returns '\0'
istream s の状態を調べ,回復不能のエラー状態にあれば,そのような エラーメッセージを標準エラー出力に書き出して,exit します。fail 状態にあれば,エラー状態を解消し,そのエラーの元になったと思われ る1文字を読みだし,その文字を返します。s の状態が正常であれば, '\0' を返します。
char pick_char(istream& s);
Back to the top of libohymos
void skip_white_and_char(istream& s, char c);
#include "common.h"
Reads in characters from istream 's'. Skips whites spaces and charater 'c'. Character c is skipped only once and when character c is encountered in the second time, character c is pushed back to the stream 's', and exits from the function.
Example
void skip_white_and_char(istream& s, char c);
Back to the top of libohymos
const int DATA2STR_BUFFSIZE = 256;
#include "common.h"
データを文字列に変換する時の文字列のサイズ
const int DATA2STR_BUFFSIZE = 256;
Back to the top of libohymos
void str2dstr( char* str, char* dstr, int dstrSize );
#include "common.h"
Transform string "str" written in "simple data format for input and output" into a data string "dstr". The area for creating the data string "dstr" must be prepared in the unit which calls this function before this function is called. "dstrSize" is the size of the prepared area "dstr".
void str2dstr( char* str, char* dstr, int dstrSize );
Back to the top of libohymos
void ignore(FILE* fp, char c);
#include "common.h"
Read character sequence untill it reads the character c. The character sequence including c will be thrown away.
void ignore(FILE* fp, char c);
Back to the top of libohymos
void data2file( float f, FILE* fp );
#include "data2str.h"
Prints a float-type datum into a file in the data format for internal work
void data2file( float f, // float-type datum FILE* fp // file pointer to the file );
Back to the top of libohymos
void data2ofile( float f, FILE* fo );
#include "data2str.h"
Prints a float-type datum into a file in the simple data format.
void data2ofile( float f, // float-type datum FILE* fo // file pointer to the file );
Back to the top of libohymos
void data2file(double a, FILE* fp);
#include "data2str.h"
Prints a double-type datum into a file in the data format for internal work
void data2file(double a, FILE* fp);
Back to the top of libohymos
void data2ofile(double a, FILE* fo);
#include "data2str.h"
Prints a double-type datum into a file in the simple data format.
void data2ofile(double a, FILE* fo);
Back to the top of libohymos
void data2file(int k, FILE* fp);
#include "data2str.h"
Prints an int-type datum into a file in the data format for internal work
void data2file(int k, FILE* fp);
Back to the top of libohymos
void data2ofile(int k, FILE* fo);
#include "data2str.h"
Prints an int-type datum into a file in the simple data format.
void data2ofile(int k, FILE* fo);
Back to the top of libohymos
void data2file(long k, FILE* fp);
#include "data2str.h"
Prints a long-type datum into a file in the data format for internal work
void data2file(long k, FILE* fp);
Back to the top of libohymos
void data2ofile(long k, FILE* fo);
#include "data2str.h"
Prints a long-type datum into a file in the simple data format.
void data2ofile(long k, FILE* fo);
Back to the top of libohymos
void dstr2data(char*& data_string, double& a);
#include "data2str.h"
Read a double datum from the string starting at data_string and put the pointer data_string further to the next reading point.
データ文字列を double に. データ読み込みのポインタを先へ進めます。
void dstr2data(char*& data_string, double& a);
Back to the top of libohymos
void dstr2data(char*& data_string, float& f);
#include "data2str.h"
Read a float datum from the string starting at data_string and put the pointer data_string further to the next reading point.
データ文字列を float に. データ読み込みのポインタを先へ進めます。
void dstr2data(char*& data_string, float& f);
Back to the top of libohymos
void dstr2data(char*& data_string, int& k);
#include "data2str.h"
Read an int datum from the string starting at data_string and put the pointer data_string further to the next reading point.
データ文字列を int に. データ読み込みのポインタを先へ進めます。
void dstr2data(char*& data_string, int& k);
Back to the top of libohymos
void dstr2data(char*& data_string, long& k);
#include "data2str.h"
Read a long datum from the string starting at data_string and put the pointer data_string further to the next reading point.
データ文字列を long に. データ読み込みのポインタを先へ進めます。
void dstr2data(char*& data_string, long& k);
Back to the top of libohymos
void Clf_dp(void* dp) ;
#include "datapack.h"
Definition of function Clf_dp which is used for deleting list-type object which stores datapack. This function is used in send.cc
inline void Clf_dp(void* dp) ;
Function is currently defined inline.
Back to the top of libohymos
FILE* dataFileOpen(char* fname);
#include "dfopen.h"
Creates a temporary data file from the file "fname" and returns the file pointer to that data file. The temporary data file is created by copying the original file "fname" but by removing comment strings that start with "#".
When the user executes fclose with the file pointer as the argument, that temporary data file will be automatically deleted.
FILE* dataFileOpen(char* fname);
Back to the top of libohymos
Element_for_test* NewElement() ;
#include "elm_t.h"
Returns a pointer to a new Element
virtual Element_for_test* NewElement() ;
Function is currently defined inline.
Back to the top of libohymos
Boolean Init(char* o_name, int o_num, char* p_str ) ;
#include "elm_t.h"
Boolean Init(char* o_name, int o_num, char* p_str = NULL) ;
Function is currently defined inline.
Back to the top of libohymos
Element_for_test(char* o_name, int o_num, char* p_str ) ;
#include "elm_t.h"
Element_for_test(char* o_name, int o_num, char* p_str = NULL) ;
Function is currently defined inline.
Back to the top of libohymos
Element_for_test(void) ;
#include "elm_t.h"
Element_for_test(void) ;
Function is currently defined inline.
Back to the top of libohymos
~Element_for_test(void) ;
#include "elm_t.h"
~Element_for_test(void) ;
Function is currently defined inline.
Back to the top of libohymos
void Pass_whites_and_comments( FILE*& fp, char& current, char comment );
#include "f_look.h"
Move forward the file pointer "fp" untill a non-white character is encountered. Comment strings are also skipped.
ホワイトスペース, 空行, コメント文を送り, fp を進めます. comment は、コメント文字列開始の文字です。通常は、'#' を指定 してください。comment が NULL のときは、空白文字だけをスキッ プします。
void Pass_whites_and_comments( FILE*& fp, // file pointer char& current, // input. the character to which the current // "fp" points // output. encountered non-white character char comment // comment character );
Back to the top of libohymos
int Get_line_number( FILE*& fp );
#include "f_look.h"
fp が指すファイル位置の行番号を取得します.
int Get_line_number( FILE*& fp // 行番号を調べるファイルのポインタ );
Back to the top of libohymos
Boolean Make_data_string( char* f_name, FILE*& fp, char& current, char*& d_str, int& d_strlen, char head, char tail, char comment, char control );
#include "f_look.h"
ファイル f_name の fp 以降で, head, tail に囲まれた 部分をヒープに確保した文字列 d_str にコピーし, データ文字列を 作成します.
Boolean Make_data_string( char* f_name, // ファイル名 FILE*& fp, // ファイルポインタ char& current, // fp が指している文字 char*& d_str, // output. データ文字列 int& d_strlen, // データ文字列の長さ char head, // '(' char tail, // ')' char comment, // '#' char control // 行末連続処理文字コード '\' );
Back to the top of libohymos
Boolean Get_string(FILE*& fp, char& current, char*& str, char control);
#include "f_look.h"
Boolean Get_string(FILE*& fp, char& current, char*& str, char control);
Back to the top of libohymos
int Get_strings(FILE*& fp, char& current, char**& str_array, int num_of_strs, char comment, char control);
#include "f_look.h"
int Get_strings(FILE*& fp, char& current, char**& str_array, int num_of_strs, char comment, char control);
Back to the top of libohymos
int khmkdir( char* dir, mode_t mode );
#include "khmkdir.h"
int khmkdir( //; make a directory char* dir, //; the directory to be made. Ex. foo/bar mode_t mode //; mode // // If the parent directory has not yet created, it will be also // created. For example, dir is foo/bar and directory foo // does not exist, then foo is also created by this function. );
Back to the top of libohymos
Library "libohymos" provides classes for treating rainfall-runoff programs.
OHyMoS は、水文モデルを「構造的モデル化法」によって作成するためのシ
ス テムで、オブジェクト指向言語 C++ を使って実現されています。
「構造的モデル化法」とは、各水文モデルに共通な構造を抽出して、あらか
じめ モデル化しておき、個々の水文要素モデルは、この共通構造を継承し
て作成して 行こうとする方法です。
現在のところ、個々の水文モデルもオブジェクト指向言語 C++ を使って記
述さ れなければなりません。
OHyMoS は次のような特徴を持っています。
この文書は、Ohymos-current (ohymos-2.4d.tgz の後で、椎葉が編集中のも
のです。) の解説です。ohymos-2.4d.tgz にほぼ対応しています。
OHyMoS のユーザの間で情報を交換するためのメイリングリストohymos-ML
が運営されています。
OHyMoS のソースは、
http://hywr.kuciv.kyoto-u.ac.jp/ohymos.html から取得できます。
Back to the top of libohymos
class hierarchy from Object to I_file<T>, O_file<T> Object <-- Port <-- Sender_port <--+ | +-------------------------------------+ | +--- Send_port <-- Input_port <-- Input_file <--+-- I_file<T> | Port_type<T> <--+ Object <-- Port <--+ | +---------------------+ | +--- Receive_port <-- Output_port <-- Output_file <--+-- O_file<T> | Port_type<T> <--+ -------------------------------------------------------------------- class hierarchy from Object to Send<T>, Receive<T>, Relay<T> Object <-- Port <-- Sender_port <-- Send_port <--+-- Send<T> | Port_type<T> <--+ Object <-- Port <-- Sender_port <-- Relay_port <--+-- Relay<T> | Port_type<T> <--+ Object <-- Port <-- Receive_port <--+-- Receive<T> | Port_type<T> <--+ Object <-- Port <-- Receive_port <--+-- ReceiveNointp<T> | Port_type<T> <--+ -------------------------------------------------------------------- class hierarchy from Object to Total_system Object <-- Element <-- Sub_system <-- Total_system -------------------------------------------------------------------- class hierachy to Data Data_pack <--+-- Data<T> | Port_type<T> <--+ -------------------------------------------------------------------- OHyMosString Vary
Back to the top of libohymos
The following macros are defined in common.h.
つぎのマクロが common.h で定義されています。
Back to the top of libohymos
typedef void (*Clear_function)(void* obj);
#include "list.h"
ヒープに確保した Node を delete する時, Node::object が指す先の実体
を消去するために定義します. (List::List 参照)
typedef void (*Clear_function)(void* obj);
Back to the top of libohymos
Report problems to jkotula@stratasys.com