00001 /***************************************************************** lm-cpr beg 00002 * 00003 * AI Loom - A cross platform artificial intelligence framework 00004 * AI Loom is (c) Copyright 2003 Josh Brown 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public 00017 * License along with this library; if not, write to the 00018 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 * Boston, MA 02111-1307, USA. 00020 * 00021 * ----------------------------------------------------------------- 00022 * File: $RCSfile: NetworkConnection.h,v $ 00023 * Date modified: $Date: 2003/10/10 07:16:58 $ 00024 * Version: $Revision: 1.7 $ 00025 * ----------------------------------------------------------------- 00026 * 00027 ************************************************************** lm-cpr-end */ 00028 #ifndef LM_NETWORK_CONNECTION_H 00029 #define LM_NETWORK_CONNECTION_H 00030 00031 #include <iostream> 00032 #include <list> 00033 00034 // plexus includes 00035 #include <plx/Router/NodePtr.h> 00036 00037 // boost includes 00038 #include <boost/shared_ptr.hpp> 00039 00040 00041 namespace lm 00042 { 00043 00044 class LoomKernel; 00045 00046 class NetworkConnection 00047 { 00048 public: 00052 NetworkConnection(int port, LoomKernel* ac); 00053 00054 00056 ~NetworkConnection(); 00057 00058 00060 bool connect(std::string host, int port); 00061 00065 void add(LoomKernel* ac); 00066 00067 plx::NodePtr getPlexusNode(); 00068 00069 private: 00070 plx::NodePtr localNode; 00071 LoomKernel* mLoomKernel; 00072 00073 }; 00074 00075 } // end namespace lm 00076 00077 #endif 00078 00079