19 void split(
const std::string &text,
const std::string &separators, std::vector<std::string> &words)
21 int n = text.length();
22 int start = text.find_first_not_of(separators);
23 while ((start >= 0) && (start < n)) {
24 int stop = text.find_first_of(separators, start);
25 if ((stop < 0) || (stop > n))
27 words.push_back(text.substr(start, stop - start));
28 start = text.find_first_not_of(separators, stop + 1);
35 puts(
"Starting source controller");
38 std::vector<std::string> words;
42 assert(words.size() == 2);
43 assert(words[1].size() > 0);
46 info->
capacity = atoi(words[1].c_str());
48 printf(
"Source Capacity: %u\n", info->
capacity);
unsigned int GetFlagCount() const
The Stage library uses its own namespace.
void Init(int *argc, char **argv[])
int(* model_callback_t)(Model *mod, void *user)
void split(const std::string &text, const std::string &separators, std::vector< std::string > &words)
void AddCallback(callback_type_t type, model_callback_t cb, void *user)
int Update(Model *mod, info_t *info)
void PushFlag(Flag *flag)