00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "ColCOWS_RemoteWorkspaceManager.hh"
00028 #include "ColCOWS_WorkspaceDesc.hh"
00029 #include "ColCOWS_Corba.hh"
00030
00031 using namespace std;
00032
00033 __COLCOWS_BEGIN__
00034
00035
00036
00037 void RemoteWorkspaceManager::printself( std::ostream & stream , int indent ) const
00038 {
00039 std::string space;
00040 for(int i = 0; i < indent; i++, space += COLCOWS_TAB);
00041
00042 stream << space << "nb connected workspaces : " << size() << std::endl;
00043
00044 for( const_iterator it = begin(); it != end() ; ++it ){
00045 stream << "*" ;
00046 it->second->printself(stream, indent+1);
00047 stream << endl;
00048 }
00049 }
00050
00051
00052
00053 void RemoteWorkspaceManager::addRemoteWorkspace( WorkspaceDesc * workspace_desc )
00054 {
00055 COLCOWS_IN_DEBUG( );
00056
00057 iterator it = find(workspace_desc->getNumConnection());
00058 COLCOWS_ASSERT( (it == end()) , "Remote workspace " << workspace_desc->getNumConnection() << " is already in the manager.");
00059
00060 insert( make_pair(workspace_desc->getNumConnection(), workspace_desc ));
00061
00062 COLCOWS_OUT_DEBUG( );
00063 return;
00064 }
00065
00066
00067
00068 void RemoteWorkspaceManager::removeRemoteWorkspace( unsigned long num_connection )
00069 {
00070 COLCOWS_IN_DEBUG( );
00071
00072 iterator it = find( num_connection );
00073 COLCOWS_ASSERT( (it != end()) , "Remote workspace " << num_connection << " is not in the manager.");
00074
00075 delete it->second;
00076
00077 erase(it);
00078
00079 COLCOWS_OUT_DEBUG( );
00080 return;
00081 }
00082
00083
00084
00085 __COLCOWS_END__
00086
00087
00088