Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

CharonClient.h

Go to the documentation of this file.
00001 #ifndef CharonClientH
00002 #define CharonClientH
00003 /*******************************************************************************
00004 Copyright 2002 Petr Kulhanek
00005 
00006     This file is part of Core plugin.
00007 
00008     Core plugin is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     Core plugin is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with Core plugin; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 *******************************************************************************/
00022 /*******************************************************************************
00023 ** PROJECT:             Project NEMESIS
00024 ** FILE:                CharonClient
00025 ** FUNCTION:            comunication with CHARON system
00026 ** VERSION:             1.0
00027 ** LANGUAGE:            CBuilder C++
00028 ** TARGET COMPUTER:     IBM PC
00029 ** PROGRAMMER:          Petr Kulhánek
00030 ** HISTORY:
00031 VERSION DATE        NOTE
00032 1.0     2002-07-29
00033 *******************************************************************************/
00034 
00038 /* HEADER FILES ***************************************************************/
00039 
00040 #include "CoreMainHeader.h"
00041 #include "ExtObject.h"
00042 #include <scktcomp.hpp>
00043 #include "XMLNetFile.h"
00044 
00045 /* HEADER FILES END ***********************************************************/
00046 
00047 
00048 class CJob;
00049 class CCharonWatcher;
00050 
00051 
00052 //---------------------------------------------------------------------------
00053 
00055 
00058 class NEMESIS_CORE_PACKAGE CCharonClient : CExtObject{
00059     public:
00060         __fastcall CCharonClient(void);
00061         __fastcall ~CCharonClient(void);
00062 
00063  // initialize charon client ----------
00064     bool __fastcall Init(void);
00065     bool __fastcall Disconnect(void);
00066 
00067     inline const CSmallString& __fastcall GetCharonIP(void);
00068     inline const int           __fastcall GetCharonPort(void);
00069     inline const int           __fastcall GetCharonWatcherPort(void);
00070     bool __fastcall SetCharonNewSettings(const CSmallString& ip,int port);
00071 
00072  // job management -----------------------------------------
00073     bool __fastcall SubmitJob(CJob* p_job);
00074     bool __fastcall SubmitJob(CJob* p_job,int comp_id,int queue_id);
00075     bool __fastcall SynchronizeJob(CJob* p_job);
00076     bool __fastcall PauseJob(CJob* p_job);
00077     bool __fastcall ResumeJob(CJob* p_job);
00078     bool __fastcall KillJob(CJob* p_job);
00079 
00080     CXMLElement* __fastcall GetJobTicket(CJob* p_job);
00081 
00082     bool __fastcall AddJobWatch(CJob* p_job);
00083     bool __fastcall RemoveJobWatch(CJob* p_job);
00084 
00085     private:
00086     CSmallString        CharonIP;
00087     int                 CharonPort;
00088     int                 CharonWatcherPort;
00089     int                 NumOfAttempt;
00090     CCharonWatcher*     CharonWatcher;
00091     TClientSocket*      ClientSocket;
00092     CXMLNetFile         XMLNetFile;
00093 
00094     bool __fastcall TryConnect(void);
00095 
00096     void __fastcall SocketError(TObject* Sender, TCustomWinSocket* Socket, TErrorEvent ErrorEvent, int &ErrorCode);
00097     };
00098 
00099 //---------------------------------------------------------------------------
00100 
00101 inline const CSmallString& __fastcall CCharonClient::GetCharonIP(void)
00102 {
00103  return(CharonIP);
00104 }
00105 
00106 //---------------------------------------------------------------------------
00107 
00108 inline const int __fastcall CCharonClient::GetCharonPort(void)
00109 {
00110  return(CharonPort);
00111 }
00112 
00113 //---------------------------------------------------------------------------
00114 
00115 inline const int __fastcall CCharonClient::GetCharonWatcherPort(void)
00116 {
00117  return(CharonWatcherPort);
00118 }
00119 
00120 //---------------------------------------------------------------------------
00121 
00122 
00123 extern NEMESIS_CORE_PACKAGE CCharonClient CharonClient;
00124 
00125 //---------------------------------------------------------------------------
00126 
00127 #endif

Generated on Sun Feb 9 12:53:50 2003 for NemesisCore by doxygen1.3-rc2