/home/coin/SVN-release/Bcp-1.2.1/Bcp/src/include/BCP_message.hpp

Go to the documentation of this file.
00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #ifndef _BCP_MESSAGE_H
00004 #define _BCP_MESSAGE_H
00005 
00006 // This file is fully docified.
00007 
00008 #include <utility>
00009 
00010 #include "BCP_string.hpp"
00011 #include "BCP_message_tag.hpp"
00012 #include "BCP_vector.hpp"
00013 
00014 //#############################################################################
00015 
00016 class BCP_buffer;
00017 class USER_initialize;
00018 
00019 //#############################################################################
00020 
00021 const int BCP_AnyProcess = -1;
00022 
00030 class BCP_message_environment{
00031 public:
00036     virtual ~BCP_message_environment() {}
00043     virtual int register_process(USER_initialize* user_init) = 0;
00050     virtual int parent_process() = 0;
00057     virtual bool alive(const int pid) = 0;
00061     virtual const int* alive(int num, const int* pids) = 0;
00068     virtual void send(const int target, const BCP_message_tag tag) = 0;
00071     virtual void send(const int target, const BCP_message_tag tag,
00072                       const BCP_buffer& buf) = 0;
00079     virtual void multicast(int num, const int* targets,
00080                            const BCP_message_tag tag) = 0;
00083     virtual void multicast(int num, const int* targets,
00084                            const BCP_message_tag tag,
00085                            const BCP_buffer& buf) = 0;
00088     // blocking receive w/ timeout (ms??) from given source given msgtag (can
00089     // give wildcard anymsg, anyproc)
00090 
00103     virtual void receive(const int source,
00104                          const BCP_message_tag tag, BCP_buffer& buf,
00105                          const double timeout) = 0;
00112     virtual bool probe(const int source, const BCP_message_tag tag) = 0; 
00120     virtual int start_process(const BCP_string& exe,
00121                               const bool debug) = 0;
00123     virtual int start_process(const BCP_string& exe,
00124                               const BCP_string& machine,
00125                               const bool debug) = 0;
00131     virtual bool start_processes(const BCP_string& exe,
00132                                  const int proc_num,
00133                                  const bool debug,
00134                                  int* ids) = 0;
00141     virtual bool start_processes(const BCP_string& exe,
00142                                  const int proc_num,
00143                                  const BCP_vec<BCP_string>& machines,
00144                                  const bool debug,
00145                                  int* ids) = 0;
00151     virtual int num_procs() { return 0; }
00154     //    virtual void stop_process(int process) = 0;
00155     //    virtual void stop_processes(BCP_proc_array& processes) = 0;
00156 };
00157 
00158 #endif

Generated on Thu Jan 15 03:00:58 2009 for coin-Bcp by  doxygen 1.4.7