1 #include <../../nrnconf.h> 10 #if defined(HAVE_SSTREAM) // the standard ... 20 bool operator() (
int i,
int j)
const {
25 class KeepArgs :
public std::map<int, const MessageValue*, ltint>{};
41 keepargs_ =
new KeepArgs();
60 if (!taking_ || taking_->
upkint(&i)) perror(
"upkint");
66 if(!taking_ || taking_->
upkdouble(&x)) { perror(
"upkdouble"); }
71 if(!taking_ || taking_->
upkvec(n, x)) { perror(
"upkdouble"); }
77 if( !taking_ || taking_->
upkint(&len)) { perror(
"upkstr length"); }
79 if (taking_->
upkstr(s)) { perror(
"upkstr string"); }
86 if( !taking_ || taking_->
upkint(&len)) { perror(
"upkpickle length"); }
88 if (taking_->
upkpickle(s, n)) { perror(
"upkpickle data"); }
100 if( !posting_ || posting_->
pkint(i)) { perror(
"pkint"); }
104 if( !posting_ || posting_->
pkdouble(x)) { perror(
"pkdouble"); }
108 if( !posting_ || posting_->
pkvec(n, x)) { perror(
"pkdouble"); }
112 if ( !posting_ || posting_->
pkint(strlen(s))) { perror(
"pkstr length"); }
113 if ( !posting_ || posting_->
pkstr(s)) { perror(
"pkstr string"); }
117 if ( !posting_ || posting_->
pkint(n)) { perror(
"pkpickle size"); }
118 if ( !posting_ || posting_->
pkpickle(s, n)) { perror(
"pkpickle data"); }
122 server_->
post(key, posting_);
130 bool b = server_->
look_take(key, &taking_);
137 bool b = server_->
look(key, &taking_);
151 perror(
"take blocking");
185 int id = look_take_todo();
187 perror(
"take_todo blocking");
193 server_->
post_todo(working_id_, posting_);
194 #if defined(HAVE_STL) 196 std::pair<const int, const MessageValue*>(userid, posting_)
203 #if defined(HAVE_STL) 204 KeepArgs::iterator
i = keepargs_->find(userid);
205 assert(i != keepargs_->end());
219 if (started_) {
return; }
virtual void save_args(int)
static double userid(void *v)
static MessageValue * posting_
virtual void upkvec(int, double *)
virtual char * upkpickle(size_t *size)
virtual void post_result(int id)
int look_take_result(int pid, MessageValue **)
int look_take_todo(MessageValue **)
virtual bool look_take(const char *)
void post_todo(int parentid, MessageValue *)
virtual void perror(const char *)
static double map(void *v)
virtual void post(const char *)
int const size_t const size_t n
bool look(const char *key, MessageValue **)
virtual void return_args(int userid)
bool look_take(const char *key, MessageValue **)
void post_result(int id, MessageValue *)
void hoc_execerror(const char *, const char *)
virtual double upkdouble()
virtual int look_take_result(int pid)
virtual void pkstr(const char *)
virtual void unref() const
virtual int look_take_todo()
int pkpickle(const char *, size_t)
static BBSLocalServer * server_
virtual void take(const char *)
void post(const char *key, MessageValue *)
virtual void pkdouble(double)
int upkpickle(char *, size_t *)
int upkvec(int, double *)
virtual void return_args(int)
virtual bool look(const char *)
static MessageValue * taking_
virtual void pkvec(int, double *)
virtual void post_todo(int parentid)
virtual void pkpickle(const char *, size_t)