PCMClient.h

Go to the documentation of this file.
00001 
00002 //
00003 // This source file is a part of ParCompMark
00004 // Parallel Compositing Benchmark Framework
00005 //
00006 // for latest info see http://parcompmark.sourceforge.net
00007 
00008 //
00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team
00010 // 
00011 // This program is free software; you can redistribute it and/or
00012 // modify it under the terms of the GNU General Public License
00013 // as published by the Free Software Foundation; either version 2
00014 // of the License, or (at your option) any later version.
00015 // 
00016 // This program is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 // GNU General Public License for more details.
00020 // 
00021 // You should have received a copy of the GNU General Public License
00022 // along with this program; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00024 
00027 
00028 #ifndef __PCM_CLIENT_H__
00029 #  define __PCM_CLIENT_H__
00030 
00031 //
00032 // Inner includes
00033 //
00034 
00035 #  include "PCMPremeditations.h"
00036 
00037 #  include "PCMNetwork.h"
00038 
00039 #  include "PCMStringConverter.h"
00040 
00041 #  include "PCMCluster.h"
00042 
00043 #  include "PCMHostInfo.h"
00044 
00045 #  include "PCMHost.h"
00046 
00047 namespace ParCompMark
00048 {
00049 
00054   class Client:public Network
00055   {
00056 
00057         //
00058         // Unit test class
00059         //
00060 #  ifdef PARCOMPMARK_TEST
00061         friend class ParCompMarkTest::TestClient;
00062 #  endif
00063 
00064         //
00065         // Typedefs
00066         //
00067 
00068    public:
00069 
00071         typedef ParCompMark::Pointer < Client,
00072         DummyLock > Pointer;
00073 
00074         //
00075         // Variables
00076         //
00077 
00079 
00080 
00081    protected:
00082 
00088         std::string mServerIP;
00089 
00095         std::string mType;
00096 
00102         Network *mParent;
00103 
00109         std::string mMessage;
00110 
00112 
00113         //
00114         // Constructors & destructor
00115         //
00116 
00118 
00119 
00120    public:
00121 
00126         Client(const std::string & name);
00127 
00131         virtual ~ Client();
00132 
00134 
00135         //
00136         // Getters & setters
00137         //
00138 
00140 
00141 
00142    public:
00143 
00149         const std::string & getServerIP() const;
00150 
00156         void setServerIP(const std::string & serverip);
00157 
00163         const std::string & getType() const;
00164 
00170         void setType(const std::string & type);
00171 
00177         Network *getParent() const;
00178 
00184         const std::string & getMessage() const;
00185 
00191         void setMessage(const std::string & message);
00192 
00194 
00195         //
00196         // Methods
00197         //
00198 
00200 
00201 
00202    public:
00203 
00207         virtual void openConnection();
00208 
00212         virtual void closeConnection();
00213 
00219         virtual void sendMessage(const std::string & type, const std::string & message);
00220 
00224         virtual void recieveMessage();
00225 
00229         virtual void handleMessage();
00230 
00232 
00233   };
00234 
00235   //
00236   // Include header implementation
00237   //
00238 
00239 #  include "PCMClient_impl.h"
00240 
00241 }
00242 
00243 #endif