/* * $Id: serverlist.h,v 1.3 2007/03/02 13:02:41 ozawa Exp $ * * Copyright 2003- ONGS Inc. All rights reserved. * * author: Masanori OZAWA (ozawa@ongs.co.jp) * version: $Revision: 1.3 $ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY ONGS INC ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL ONGS INC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * The views and conclusions contained in the software and documentation are * those of the authors and should not be interpreted as representing official * policies, either expressed or implied, of the ONGS Inc. * */ #ifndef ___SERVERLIST_H #define ___SERVERLIST_H #include "glib.h" class ServerList { public: /** * コンストラクタ */ ServerList(); /** * デストラクタ */ ~ServerList(); /** * 一覧にサーバ情報を追加します * * @param szUserName ユーザ名 * @param szHostName ホスト名 * @param szIPAddr IPアドレス * @param nPort ポート番号 * @param nExtInfo サーバの拡張情報 */ void add(Glib::ustring szUserName, Glib::ustring szHostName, Glib::ustring szIPAddr, in_port_t nPort, u_int32_t nExtInfo); /** * 一覧を削除します */ void clear(); /** * 一覧のサイズを取得します */ int size(); /** * ユーザ名の一覧を取得します */ std::list& getUserNameList(); /** * ホスト名の一覧を取得します */ std::list& getHostNameList(); /** * IPアドレスの一覧を取得します */ std::list& getIPAddrList(); /** * ポート番号の一覧を取得します */ std::list& getPortList(); /** * サーバの拡張情報の一覧を取得します。 */ std::list& getExtInfoList(); /** * 一覧の更新処理を一時停止します */ void lockList(); /** * 一覧の更新処理の一時停止を解除します */ void unlockList(); private: /** * 同期処理用ミューテックス */ Glib::Mutex m_cMutex; /** * ユーザ名の一覧 */ std::list m_cUserName; /** * ホスト名の一覧 */ std::list m_cHostName; /** * IPアドレスの一覧 */ std::list m_cIPAddr; /** * IPアドレスの一覧 */ std::list m_cPort; /** * サーバの拡張情報の一覧 */ std::list m_cExtInfo; }; #endif