bbsrcli.h

Go to the documentation of this file.
00001 #ifndef bbsrcli_h
00002 #define bbsrcli_h
00003 
00004 #include <nrnmpiuse.h>
00005 #include "bbsimpl.h"
00006 class KeepArgs;
00007 struct bbsmpibuf;
00008 
00009 class BBSClient : public BBSImpl{ // implemented as PVM Client
00010 public:
00011    BBSClient();
00012    virtual ~BBSClient();
00013 
00014    virtual boolean look(const char*);
00015 
00016    virtual void take(const char*); /* blocks til something to take */
00017    virtual boolean look_take(const char*); /* returns false if nothing to take */
00018    // after taking use these
00019    virtual int upkint();
00020    virtual double upkdouble();
00021    virtual void upkvec(int, double*);
00022    virtual char* upkstr(); // delete [] char* when finished
00023    virtual char* upkpickle(size_t*); // delete [] char* when finished
00024 
00025    // before posting use these
00026    virtual void pkbegin();
00027    virtual void pkint(int);
00028    virtual void pkdouble(double);
00029    virtual void pkvec(int, double*);
00030    virtual void pkstr(const char*);
00031    virtual void pkpickle(const char*, size_t);
00032    virtual void post(const char*);
00033 
00034    virtual void post_todo(int parentid);
00035    virtual void post_result(int id);
00036    virtual int look_take_result(int pid); // returns id, or 0 if nothing
00037    virtual int look_take_todo(); // returns id, or 0 if nothing
00038    virtual int take_todo(); // returns id
00039    virtual void save_args(int);
00040    virtual void return_args(int);
00041 
00042    virtual void start();
00043    virtual void done();
00044 
00045    virtual void perror(const char*);
00046 private:
00047    int get(const char* key, int type); // return type
00048    int get(int key, int type); // return type
00049    int get(int type); // return type
00050 private:
00051    static int sid_;
00052    KeepArgs* keepargs_;
00053 #if NRNMPI
00054    void upkbegin();
00055    char* getkey();
00056    int getid();
00057    bbsmpibuf* sendbuf_, *recvbuf_, *request_;
00058 #endif
00059    
00060 };
00061 
00062 #endif
Generated on Mon Jun 13 08:10:28 2011 for NEURON by  doxygen 1.6.3