ユーティリティ・クラスのリファレンス
この章では、便利ではあるものの Caché のデータ型に対応せず、プロキシによって自動的に継承されないクラスについて説明します。
データ処理クラス
-
Transaction — プログラムで例外が発生した場合に、自動的にロールバックを行います。
-
LC_Batch — Light C++ バインディング用のバッチ挿入クラスです。
-
d_query — SQL 文の作成、パラメータの結合、クエリの実行、および結果セットの検索の各メソッドを提供します。
InterSystems::Transaction クラス
このクラスでは、例外発生時の自動的なロールバック動作が保証されます。commit() または rollback() のいずれも呼び出されていないときに、Transaction オブジェクトが範囲外になると、そのトランザクションはロールバックされます。Database トランザクション・メソッドと異なり、このクラスでは、入れ子になったトランザクションは許可されません。両タイプのトランザクションの詳細は、"トランザクションの使用法" を参照してください。
コンストラクタ
クラス・コンストラクタがトランザクションを開始します (Database::tstart() の呼び出しを必要とする Database オブジェクトとは異なります)。
InterSystems::Transaction::Transaction
( Database * _db ) [inline]
メンバ・リスト
トランザクションをコミットします。
void InterSystems::Transaction::commit
( ) [inline]
同じ Transaction オブジェクトに対して commit() を複数回呼び出しても何も実行されません (入れ子になったトランザクションの複数レベルでロールバックを実行するために繰り返し呼び出すことのできる Database::tcommit() とは異なります)。
現在のトランザクションをロールバックします。
void InterSystems::Transaction::rollback
( ) [inline]
トランザクションがコミットまたはロールバックされる前に Transaction オブジェクトが範囲外になると、自動的に呼び出されます。
InterSystems::LC_Batch クラス
このクラスは、Light C++ バインディングを使用したバッチ挿入のメソッドを提供します。詳細は、"LCB バッチ挿入の使用法" を参照してください。
コンストラクタ
InterSystems::LC_Batch::LC_Batch
( LC_Database * _db,
int _concurrency = 1,
bool _return_ids = false,
bool _throw_errs = true,
size_t reserve_size = 32768,
bool _do_tx = false
) [inline]
メンバ・リスト
バッチに追加されているオブジェクトを保存しないようにするには、clear() を呼び出します。
void InterSystems::LC_Batch::clear
( ) [inline]
void InterSystems::LC_Batch::clear_errors
( ) [inline]
void InterSystems::LC_Batch::clear_ids
( ) [inline]
void LC_Batch::close
( )
オブジェクトをデータベースに保存するには、flush()、close() を呼び出すか、バッチ・オブジェクトを破棄します。
void LC_Batch::flush
( )
エラーのリストが返されます。
const std::vector< std::pair<d_status, d_binary> >&
InterSystems::LC_Batch::get_errors
( ) const [inline]
flush() の実行後、get_errors() によって以下のリストが返されます。
-
エラーがない場合、リストの size() は 0 になります。
-
エラーがある場合、各リストのエントリは、エラー・ステータスとオブジェクト・シリアル化の組み合わせになります。
-
プロジェクション・オブジェクトには set_from_err_list() メンバ関数があり、エラーの発生したオブジェクトのプロパティを検証できます。
const std::vector<d_string>& InterSystems::LC_Batch::get_ids
( ) const [inline]
template<typename T>
LC_Batch& InterSystems::LC_Batch::operator<<
( const d_ref< T > & obj) [inline]
template<typename T>
LC_Batch& InterSystems::LC_Batch::operator<<
( const lc_d_ref< T > & obj) [inline]
template<typename T>
LC_Batch& InterSystems::LC_Batch::operator<<
( T * obj) [inline]
InterSystems::d_query クラス
SQL 文の作成、パラメータの結合、クエリの実行、および結果セットの検索の各メソッドを提供します。このクラスの詳細は、"クエリの使用法" を参照してください。
コンストラクタ
InterSystems::d_query::d_query
( ) [inline]
InterSystems::d_query::d_query
( Database * db) [inline]
メンバ・リスト
bool abs_d_query::close
( ) [inherited]
void abs_d_query::execute
( ) [inherited]
void InterSystems::abs_d_query::execute
( const wchar_t * sql_query) [inline, inherited]
bool InterSystems::d_seq_query::fetch
( ) [inline, inherited]
const SQLWCHAR* InterSystems::abs_d_query::get_col_name
( int idx) const [inline, inherited]
SQLSMALLINT InterSystems::abs_d_query::get_col_name_len
( int idx) const [inline, inherited]
SQLSMALLINT InterSystems::abs_d_query::get_col_sql_type
( int idx) const [inline, inherited]
int InterSystems::d_seq_query::get_cur_idx
( ) const [inline, inherited]
void d_seq_query::get_data
( char * buf,
int * size,
int cap,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( d_binary * val) [inherited]
void d_seq_query::get_data
( d_bool * val) [inherited]
void d_seq_query::get_data
( d_currency * val) [inherited]
void d_seq_query::get_data
( d_date * val) [inherited]
void d_seq_query::get_data
( d_double * val) [inherited]
void d_seq_query::get_data
( d_int * val) [inherited]
void d_seq_query::get_data
( d_string * val,
str_conv_t conv = NO_CONV
) [inherited]
void d_seq_query::get_data
( d_time * val) [inherited]
void d_seq_query::get_data
( d_timestamp * val) [inherited]
void d_seq_query::get_data
( D_type * val) [inherited]
void d_seq_query::get_data
( d_wstring * val) [inherited]
void d_seq_query::get_data
( DATE_STRUCT * val,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( double * val,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( long * val,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( std::string * val,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( std::wstring * val,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( TIME_STRUCT * val,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( TIMESTAMP_STRUCT * val,
bool * is_nuol = 0
) [inherited]
void d_seq_query::get_data
( void * buf,
int * size,
int cap,
bool * is_null = 0
) [inherited]
void d_seq_query::get_data
( wchar_t * buf,
int * size,
int cap,
bool * is_null = 0
) [inherited]
void InterSystems::d_seq_query::get_data
( bool * val,
bool * is_null = 0
) [inline, inherited]
int InterSystems::abs_d_query::get_job_id
( ) [inline, inherited]
int InterSystems::abs_d_query::get_num_cols
( ) const [inline, inherited]
int InterSystems::abs_d_query::get_num_pars
( ) const [inline, inherited]
SQLUINTEGER InterSystems::abs_d_query::get_par_col_size
( int idx) const [inline, inherited]
SQLSMALLINT InterSystems::abs_d_query::get_par_num_dec_digits
( int idx) const [inline, inherited]
SQLSMALLINT InterSystems::abs_d_query::get_par_sql_type
( int idx) const [inline, inherited]
SQLSMALLINT InterSystems::abs_d_query::is_par_nullable
( int idx) const [inline, inherited]
bool InterSystems::abs_d_query::is_par_unbound
( int idx) const [inline, inherited]
void abs_d_query::prepare
( const char * cl_name,
const char * proc_name
) [inherited]
void abs_d_query::prepare
( const char * sql_query,
int len
) [inherited]
void abs_d_query::prepare
( const wchar_t * cl_name,
const wchar_t * proc_name
) [inherited]
void abs_d_query::prepare
( const wchar_t * sql_query,
int len
) [inherited]
void abs_d_query::prepare
( d_string & sql_name,
int num_pars
) [inherited]
void InterSystems::abs_d_query::prepare
( const char * sql_query) [inline, inherited]
void InterSystems::abs_d_query::prepare
( const wchar_t * sql_query) [inline, inherited]
void InterSystems::d_query::set_cur_idx
( int idx) [inline]
void abs_d_query::set_par
( int idx) [inherited]
void abs_d_query::set_par
( int idx,
const char * buf,
char_size_t size
) [inherited]
void abs_d_query::set_par
( int idx,
const d_binary & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_bool & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_currency & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_date & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_double & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_int & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_string & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_time & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_timestamp & val
) [inherited]
void abs_d_query::set_par
( int idx,
const D_type & val
) [inherited]
void abs_d_query::set_par
( int idx,
const d_wstring & val
) [inherited]
void abs_d_query::set_par
( int idx,
const void * buf,
byte_size_t size
) [inherited]
void abs_d_query::set_par
( int idx,
const wchar_t * buf,
char_size_t size
) [inherited]
void abs_d_query::set_par
( int idx,
double val
) [inherited]
void abs_d_query::set_par
( int idx,
int val
) [inherited]
void InterSystems::abs_d_query::set_par
( int idx,
const char * val
) [inline, inherited]
void InterSystems::abs_d_query::set_par
( int idx,
const std::string & val
) [inline, inherited]
void InterSystems::abs_d_query::set_par
( int idx,
const std::wstring & val
) [inline, inherited]
void InterSystems::abs_d_query::set_par
( int idx,
const wchar_t * val
) [inline, inherited]
void abs_d_query::set_par_default
( int idx) [inherited]
void InterSystems::abs_d_query::set_stored_proc
( bool is_stored_proc) [inline, inherited]
void InterSystems::d_seq_query::skip
( unsigned int num_cols = 1) [inline, inherited]
void abs_d_query::throw_err
( SQLSMALLINT err_src,
SQLHANDLE handle
) [static, inherited]
void abs_d_query::unbind_pars
( ) [inherited]
エラー・クラス
エラー報告を行います。
InterSystems::Db_err クラス
このクラスの使用例は、"C++ バインディング・アプリケーションのサンプル" を参照してください。
コンストラクタ
InterSystems::Db_err::Db_err
( ) [inline]
InterSystems::Db_err::Db_err
( int c) [inline]
InterSystems::Db_err::Db_err
( int c,
const char * m,
int l,
const char * s
) [inline]
InterSystems::Db_err::Db_err
( int c,
const std::string & m
) [inline]
InterSystems::Db_err::Db_err
( int c,
const std::string & m,
const char * s
) [inline]
メンバ・リスト
void InterSystems::Db_err::clear
( ) [inline]
void Db_err::get
( t_istream & in)
int InterSystems::Db_err::get_code
( ) const [inline]
const std::string& InterSystems::Db_err::get_msg
( ) const [inline]
const std::string& InterSystems::Db_err::get_src
( ) const [inline]
void Db_err::log
( ) const
std::string Db_err::make_err_msg
( const char * msg,
const char * arg1 = 0,
const char * arg2 = 0,
const char * arg3 = 0,
const char * arg4 = 0,
const char * arg5 = 0
) [static]
std::string Db_err::make_err_msg
( const char * msg,
const wchar_t * arg1 = 0,
const wchar_t * arg2 = 0,
const wchar_t * arg3 = 0,
const wchar_t * arg4 = 0,
const wchar_t * arg5 = 0
) [static]
InterSystems::Db_err::operator-bool
( ) const [inline]
void InterSystems::Db_err::reset
( int c,
const char * m
) [inline]
void InterSystems::Db_err::set_code
( int code) [inline]
void InterSystems::Db_err::set_msg
( const char * m) [inline]
void InterSystems::Db_err::set_msg
( const char * m,
int l
) [inline]
void InterSystems::Db_err::set_src
( const char * s) [inline]
void Db_err::to_xml
( xml_writer & out) const