void CCAcc::invoke(const string& method, const AmArg& args, AmArg& ret) { if(method == "getCredit"){ assertArgCStr(args.get(0)); ret.push(getCredit(args.get(0).asCStr())); } else if(method == "subtractCredit"){ assertArgCStr(args.get(0)); assertArgInt(args.get(1)); ret.push(subtractCredit(args.get(0).asCStr(), args.get(1).asInt())); } else if(method == "addCredit"){ assertArgCStr(args.get(0)); assertArgInt(args.get(1)); ret.push(addCredit(args.get(0).asCStr(), args.get(1).asInt())); } else if(method == "setCredit"){ assertArgCStr(args.get(0)); assertArgInt(args.get(1)); ret.push(setCredit(args.get(0).asCStr(), args.get(1).asInt())); } else if(method == "_list"){ ret.push("getCredit"); ret.push("subtractCredit"); ret.push("setCredit"); ret.push("addCredit"); } else throw AmDynInvoke::NotImplemented(method); }
bool Incoming::doWork() { uint32_t c = getCredit(); bool issue = window < c; if (issue) { pn_link_flow(link, c - window); window = c; } return issue; }
bool Incoming::haveWork() { return window <= (getCredit()/2); }
TSH::TSH(const QString nom, const QString code, const Saison saison, const unsigned int credits, const LigneTSH ligneTSH, const ColonneTSH colonneTSH) :\ UV::UV(nom, code, saison), _ligneTSH(ligneTSH), _colonneTSH(colonneTSH) { getCredit().setTSH(credits); }