00001 //===========================================================================// 00002 // 00003 // Description: interface for user defined event handling classes 00004 // Filename: colcows/ColCOWS_RemoteWorkspaceManager.hh 00005 // Authors: Michael Dussere and Aurélien Esnard 00006 // 00007 //===========================================================================// 00008 // 00009 // Copyright (C) 2003 INRIA and CNRS 00010 // 00011 // This library is free software; you can redistribute it and/or 00012 // modify it under the terms of the GNU Lesser General Public 00013 // License as published by the Free Software Foundation; either 00014 // version 2.1 of the License, or (at your option) any later version. 00015 // 00016 // This library 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 GNU 00019 // Lesser General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU Lesser General Public 00022 // License along with this library; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 // 00025 //===========================================================================// 00026 00027 #ifndef __COLCOWS_REMOTE_WORKSPACE_MANAGER_HH__ 00028 #define __COLCOWS_REMOTE_WORKSPACE_MANAGER_HH__ 00029 00030 //---------------------------------------------------------------------------// 00031 #include "ColCOWS_Include.hh" 00032 #include "ColCOWS_Debug.hh" 00033 //---------------------------------------------------------------------------// 00034 00035 namespace ColCOWS { 00036 class WorkspaceDesc; 00037 }; 00038 00039 __COLCOWS_BEGIN__ 00040 00041 //! Workspace Description 00042 /** 00043 * 00044 */ 00045 class RemoteWorkspaceManager : public std::map<unsigned long, WorkspaceDesc * > 00046 { 00047 00048 //================================================// 00049 //=========== class standard interface ===========// 00050 public: 00051 //! standard constructor 00052 RemoteWorkspaceManager() {} 00053 00054 //! destructor 00055 virtual ~RemoteWorkspaceManager() {} 00056 00057 //! print self 00058 virtual void printself(std::ostream & stream, int indent = 0) const; 00059 00060 //=========================================// 00061 //=========== public interface ===========// 00062 public: 00063 00064 //! get a remote remote workspace description 00065 inline WorkspaceDesc * getRemoteWorkspace( unsigned int num_connection ) 00066 { 00067 iterator it = find(num_connection); 00068 if (it == end()) 00069 return NULL; 00070 else 00071 return it->second; 00072 } 00073 00074 //! add a remote remote workspace description 00075 void addRemoteWorkspace( WorkspaceDesc * workspace_desc ); 00076 00077 //! remove a remote remote workspace description 00078 void removeRemoteWorkspace( unsigned long num_connection ); 00079 00080 //=========== Accessors ===========// 00081 public: 00082 00083 00084 protected: 00085 00086 }; 00087 00088 //------------------------------------------------------------------------// 00089 00090 //! standard output stream operator 00091 inline std::ostream & operator <<(std::ostream & stream, const RemoteWorkspaceManager & _this) 00092 { 00093 stream << "RemoteWorkspaceManager { " << std::endl; 00094 _this.printself(stream); 00095 stream << "}" << std::flush; 00096 return stream; 00097 } 00098 00099 __COLCOWS_END__ 00100 00101 #endif // __COLCOWS_REMOTE_WORKSPACE_MANAGER_HH__ 00102 00103 // EOF 00104