gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
41 #if defined(HAVE_PICOJSON)
82 parameter(
const std::string &name =
"",
const std::string &label =
"",
83 const std::string &help =
"")
97 if(it !=
_clients.end()) it->second = changed;
101 it->second = changed;
129 _clients.insert(clients.begin(), clients.end());
142 std::string::size_type last =
_name.find_last_of(
'/');
143 return _name.substr(0, last);
152 return _label +
" [" + units +
"]";
154 std::string s =
_name;
156 std::string::size_type last =
_name.find_last_of(
'/');
157 if(last != std::string::npos) s =
_name.substr(last + 1);
159 while(s.size() && s[0] ==
' ') s = s.substr(1);
162 while(s.size() && (s[0] ==
'}' || s[0] ==
'{')) s = s.substr(1);
165 while(s.size() && s[0] >=
'0' && s[0] <=
'9') s = s.substr(1);
169 return s +
" [" + units +
"]";
183 changed = std::max(changed, it->second);
205 static std::string
version() {
return "1.3"; }
208 std::string::size_type &first,
211 if(first == std::string::npos)
return "";
212 std::string::size_type last = msg.find_first_of(separator, first);
213 std::string next(
"");
214 if(last == std::string::npos) {
215 next = msg.substr(first);
218 else if(first == last) {
223 next = msg.substr(first, last - first);
228 static std::vector<std::string>
split(
const std::string &msg,
231 std::vector<std::string> out;
232 std::string::size_type first = 0;
233 while(first != std::string::npos)
237 static std::string
trim(
const std::string &str,
238 const std::string &whitespace =
" \t\n")
240 std::string::size_type strBegin = str.find_first_not_of(whitespace);
241 if(strBegin == std::string::npos)
return "";
242 std::string::size_type strEnd = str.find_last_not_of(whitespace);
243 std::string::size_type strRange = strEnd - strBegin + 1;
244 return str.substr(strBegin, strRange);
249 for(std::size_t i = 0; i < in.size(); i++)
250 if(out[i] ==
charSep()) out[i] =
' ';
255 std::ostringstream sstream;
269 return sstream.str();
271 virtual std::string::size_type
fromChar(
const std::string &msg)
273 std::string::size_type pos = 0;
282 int numAttributes = atoi(
getNextToken(msg, pos).c_str());
283 for(
int i = 0; i < numAttributes; i++) {
288 for(
int i = 0; i < numClients; i++) {
296 std::string &type, std::string &name)
298 std::string::size_type first = 0;
303 static bool fromFile(std::vector<std::string> &msg, FILE *fp)
307 if(!fgets(tmp,
sizeof(tmp), fp))
return false;
310 if(!fscanf(fp,
"%d ", &numc))
break;
313 for(
int i = 0; i < numc; i++) msg.back() += fgetc(fp);
314 if(!fgets(tmp,
sizeof(tmp), fp))
break;
318 static bool toFile(
const std::vector<std::string> &msg, FILE *fp,
319 const std::string &creator)
323 fprintf(fp,
"ONELAB database created by %s on %s", creator.c_str(),
325 for(std::size_t i = 0; i < msg.size(); i++) {
326 fprintf(fp,
"%d ", (
int)msg[i].size());
327 for(std::size_t j = 0; j < msg[i].size(); j++) fputc(msg[i][j], fp);
339 std::ostringstream sstream;
340 sstream <<
"\"type\":\"" <<
getType() <<
"\""
347 <<
", \"visible\":" << (
getVisible() ?
"true" :
"false")
348 <<
", \"readOnly\":" << (
getReadOnly() ?
"true" :
"false");
350 sstream <<
", \"attributes\":{ ";
359 sstream <<
", \"clients\":{ ";
361 if(it !=
getClients().begin()) sstream <<
", ";
362 sstream <<
"\"" <<
sanitizeJSON(it->first) <<
"\":" << it->second;
366 return sstream.str();
368 #if defined(HAVE_PICOJSON)
371 for(
auto it = par.begin(); it != par.end(); ++it) {
372 if(it->first ==
"name") {
373 if(!it->second.is<std::string>())
return false;
374 setName(it->second.get<std::string>());
376 else if(it->first ==
"label") {
377 if(!it->second.is<std::string>())
return false;
378 setLabel(it->second.get<std::string>());
380 else if(it->first ==
"help") {
381 if(!it->second.is<std::string>())
return false;
382 setHelp(it->second.get<std::string>());
384 else if(it->first ==
"changedValue") {
385 if(!it->second.is<
double>())
return false;
388 else if(it->first ==
"visible") {
389 if(!it->second.is<
bool>())
return false;
392 else if(it->first ==
"readOnly") {
393 if(!it->second.is<
bool>())
return false;
396 else if(it->first ==
"attributes") {
400 for(
auto i = obj.begin(); i != obj.end(); ++i) {
401 std::string key(i->first);
402 if(!i->second.is<std::string>())
return false;
406 else if(it->first ==
"clients") {
410 for(
auto i = obj.begin(); i != obj.end(); ++i) {
411 std::string
client(i->first);
412 if(!i->second.is<
double>())
return false;
442 number(
const std::string &name =
"",
double value = 0.,
443 const std::string &label =
"",
const std::string &help =
"")
448 number(
const std::string &name,
const std::vector<double> &values,
449 const std::string &label =
"",
const std::string &help =
"")
467 if(labels.size() !=
_choices.size())
return;
469 for(std::size_t i = 0; i <
_choices.size(); i++)
480 std::string
getType()
const {
return "number"; }
488 std::ostringstream sstream;
490 return sstream.str();
517 bool changed =
false;
518 for(std::size_t i = 0; i < p.
getValues().size(); i++) {
538 std::ostringstream sstream;
539 sstream.precision(16);
541 for(std::size_t i = 0; i <
_values.size(); i++)
545 for(std::size_t i = 0; i <
_choices.size(); i++)
551 return sstream.str();
553 std::string::size_type
fromChar(
const std::string &msg)
558 for(std::size_t i = 0; i <
_values.size(); i++)
565 for(std::size_t i = 0; i <
_choices.size(); i++)
567 int numValueLabels = atoi(
getNextToken(msg, pos).c_str());
568 for(
int i = 0; i < numValueLabels; i++) {
576 std::ostringstream sstream;
577 sstream.precision(16);
579 for(std::size_t i = 0; i <
_values.size(); i++) {
580 if(i) sstream <<
", ";
584 <<
", \"min\":" <<
_min <<
", \"max\":" <<
_max
585 <<
", \"step\":" <<
_step <<
", \"index\":" <<
_index;
587 sstream <<
", \"choices\":[ ";
588 for(std::size_t i = 0; i <
_choices.size(); i++) {
589 if(i) sstream <<
", ";
595 sstream <<
", \"valueLabels\":{ ";
598 sstream <<
"\"" <<
sanitizeJSON(it->second) <<
"\":" << it->first;
603 return sstream.str();
607 #if defined(HAVE_PICOJSON)
610 if(err.size())
return false;
613 auto it = par.find(
"type");
614 if(it == par.end())
return false;
615 if(it->second.to_str() ==
"number") {
622 #if defined(HAVE_PICOJSON)
626 for(
auto it = par.begin(); it != par.end(); ++it) {
627 if(it->first ==
"values") {
631 for(std::size_t i = 0; i < arr.size(); i++) {
632 if(!arr[i].is<double>())
return false;
633 _values[i] = arr[i].get<
double>();
636 else if(it->first ==
"min") {
637 if(!it->second.is<
double>())
return false;
638 setMin(it->second.get<
double>());
640 else if(it->first ==
"max") {
641 if(!it->second.is<
double>())
return false;
642 setMax(it->second.get<
double>());
644 else if(it->first ==
"step") {
645 if(!it->second.is<
double>())
return false;
646 setStep(it->second.get<
double>());
648 else if(it->first ==
"index") {
649 if(!it->second.is<
double>())
return false;
650 setIndex((
int)it->second.get<
double>());
652 else if(it->first ==
"choices") {
656 for(std::size_t i = 0; i < arr.size(); i++) {
657 if(!arr[i].is<double>())
return false;
661 else if(it->first ==
"valueLabels") {
665 for(
auto i = obj.begin(); i != obj.end(); ++i) {
666 if(!i->second.is<
double>())
return false;
684 string(
const std::string &name =
"",
const std::string &value =
"",
685 const std::string &label =
"",
const std::string &help =
"")
690 string(
const std::string &name,
const std::vector<std::string> &values,
691 const std::string &label =
"",
const std::string &help =
"")
706 std::string
getType()
const {
return "string"; }
709 static std::string n(
"");
726 bool changed =
false;
727 for(std::size_t i = 0; i < p.
getValues().size(); i++) {
746 std::ostringstream sstream;
748 for(std::size_t i = 0; i <
_values.size(); i++)
751 for(std::size_t i = 0; i <
_choices.size(); i++)
753 return sstream.str();
755 std::string::size_type
fromChar(
const std::string &msg)
760 for(std::size_t i = 0; i <
_values.size(); i++)
764 for(std::size_t i = 0; i <
_choices.size(); i++)
770 std::ostringstream sstream;
772 for(std::size_t i = 0; i <
_values.size(); i++) {
773 if(i) sstream <<
", ";
780 sstream <<
", \"choices\":[ ";
781 for(std::size_t i = 0; i <
_choices.size(); i++) {
782 if(i) sstream <<
", ";
788 return sstream.str();
792 #if defined(HAVE_PICOJSON)
795 if(err.size())
return false;
798 auto it = par.find(
"type");
799 if(it == par.end())
return false;
800 if(it->second.to_str() ==
"string") {
807 #if defined(HAVE_PICOJSON)
811 for(
auto it = par.begin(); it != par.end(); ++it) {
812 if(it->first ==
"values") {
816 for(std::size_t i = 0; i < arr.size(); i++) {
817 if(!arr[i].is<std::string>())
return false;
818 _values[i] = arr[i].get<std::string>();
821 else if(it->first ==
"kind") {
822 if(!it->second.is<std::string>())
return false;
823 setKind(it->second.get<std::string>());
825 else if(it->first ==
"choices") {
829 for(std::size_t i = 0; i < arr.size(); i++) {
830 if(!arr[i].is<std::string>())
return false;
831 _choices[i] = arr[i].get<std::string>();
851 std::set<T *, parameterLessThan> &ps)
853 if(name.empty() &&
client.size()) {
854 std::vector<T *> toDelete;
855 for(
auto it = ps.begin(); it != ps.end();) {
857 if(p->hasClient(
client)) {
868 auto it = ps.find(&tmp);
886 std::set<T *, parameterLessThan> &ps)
889 auto it = ps.find((T *)&p);
909 bool _get(std::vector<T> &p,
const std::string &name,
910 const std::string &
client, std::set<T *, parameterLessThan> &ps)
914 for(
auto it = ps.begin(); it != ps.end(); it++) p.push_back(**it);
918 auto it = ps.find(&tmp);
932 std::set<T *, parameterLessThan> ps)
935 auto it = ps.find(&tmp);
950 void clear(
const std::string &name =
"",
const std::string &
client =
"")
952 if(name.empty() &&
client.empty()) {
953 std::set<parameter *, parameterLessThan> ps;
955 for(
auto it = ps.begin(); it != ps.end(); it++)
delete *it;
968 bool set(
const string &p,
const std::string &
client =
"")
972 bool get(std::vector<number> &ps,
const std::string &name =
"",
973 const std::string &
client =
"")
977 bool get(std::vector<string> &ps,
const std::string &name =
"",
978 const std::string &
client =
"")
983 const std::string &
client =
"")
987 void getPtr(
string **ptr,
const std::string &name,
988 const std::string &
client =
"")
999 const std::string &search =
"")
const
1002 if(search.empty()) {
1003 for(
auto &p :
_numbers) names.push_back(p->getName());
1004 for(
auto &p :
_strings) names.push_back(p->getName());
1009 if(std::regex_search(p->getName(), std::regex(search)))
1010 names.push_back(p->getName());
1013 if(std::regex_search(p->getName(), std::regex(search)))
1014 names.push_back(p->getName());
1023 std::set<parameter *, parameterLessThan> ps;
1025 for(
auto it = ps.begin(); it != ps.end(); it++)
1026 if((*it)->hasClient(
client))
return true;
1033 std::set<parameter *, parameterLessThan> ps;
1036 for(
auto it = ps.begin(); it != ps.end(); it++) {
1037 changed = std::max(changed, (*it)->getChanged(
client));
1045 std::set<parameter *, parameterLessThan> ps;
1047 for(
auto it = ps.begin(); it != ps.end(); it++)
1048 (*it)->setChanged(changed,
client);
1052 std::set<parameter *, parameterLessThan> ps;
1054 for(
auto it = ps.begin(); it != ps.end(); it++) {
1055 int changed = (*it)->getChanged(
client);
1056 if(changed > threshold) (*it)->setChanged(threshold,
client);
1063 std::vector<std::string> s;
1064 std::set<parameter *, parameterLessThan> ps;
1066 for(
auto it = ps.begin(); it != ps.end(); it++)
1068 if((*it)->getAttribute(
"NotInDb") !=
"True")
1069 s.push_back((*it)->toChar());
1075 const std::string &
client =
"")
1077 for(std::size_t i = 0; i < msg.size(); i++) {
1078 std::string version, type, name;
1081 if(type ==
"number") {
1086 else if(type ==
"string") {
1096 bool toJSON(std::string &json,
const std::string &creator =
"",
1097 const std::string &
client =
"")
const
1101 std::string t(ctime(&now));
1102 t.resize(t.size() - 1);
1104 json +=
"{ \"onelab\":{\n";
1105 json +=
" \"creator\":\"" + creator +
"\",\n";
1106 json +=
" \"date\":\"" + t +
"\",\n";
1108 json +=
" \"parameters\":[\n";
1109 std::set<parameter *, parameterLessThan> ps;
1111 for(
auto it = ps.begin(); it != ps.end(); it++) {
1112 if(it != ps.begin()) json +=
",\n";
1114 if((*it)->getAttribute(
"NotInDb") !=
"True") {
1115 json +=
" " + (*it)->toJSON();
1119 json +=
"\n ] }\n}\n";
1124 #if defined(HAVE_PICOJSON)
1127 if(err.size())
return false;
1130 auto it = obj.find(
"onelab");
1131 if(it != obj.end()) {
1135 for(
auto j = db.begin(); j != db.end(); ++j) {
1136 if(j->first ==
"version") {
1137 if(!j->second.is<std::string>())
return false;
1141 else if(j->first ==
"parameters") {
1145 for(std::size_t k = 0; k < arr.size(); k++) {
1146 if(!arr[k].is<picojson::object>())
return false;
1161 for(std::size_t k = 0; k < arr.size(); k++) {
1162 if(!arr[k].is<picojson::object>())
return false;
1175 #if defined(HAVE_PICOJSON)
1177 const std::string &
client =
"")
1179 auto it = par.find(
"type");
1180 if(it == par.end())
return false;
1181 if(it->second.to_str() ==
"number") {
1187 else if(it->second.to_str() ==
"string") {
1218 virtual bool run() {
return false; }
1220 virtual bool kill() {
return false; }
1223 std::cout << msg << std::endl;
1227 std::cerr << msg << std::endl;
1231 std::cerr << msg << std::endl;
1235 std::cout << msg << std::endl;
1241 virtual bool clear(
const std::string &name) = 0;
1243 virtual bool set(
const string &p) = 0;
1244 virtual bool get(std::vector<number> &ps,
const std::string &name =
"") = 0;
1245 virtual bool get(std::vector<string> &ps,
const std::string &name =
"") = 0;
1249 const std::string &name =
"") = 0;
1251 const std::string &name =
"") = 0;
1254 std::vector<std::string> out;
1255 std::vector<number> n;
1257 for(std::size_t i = 0; i < n.size(); i++) out.push_back(n[i].toChar());
1258 std::vector<string> s;
1260 for(std::size_t i = 0; i < s.size(); i++) out.push_back(s[i].toChar());
1265 for(std::size_t i = 0; i < msg.size(); i++) {
1266 std::string version, type, name;
1269 if(type ==
"number") {
1274 else if(type ==
"string") {
1287 std::vector<std::string> msg;
1315 void clear(
const std::string &name =
"",
const std::string &
client =
"")
1319 template <
class T>
bool set(
const T &p,
const std::string &
client =
"")
1324 bool get(std::vector<T> &ps,
const std::string &name =
"",
1325 const std::string &
client =
"")
1329 typedef std::set<client *>::iterator
citer;
1336 if((*it)->getName() == name)
return it;
1359 const std::string &search =
"")
const
1368 const std::string &
client =
"")
1378 std::vector<std::string> msg;
1395 template <
class T>
bool _set(
const T &p)
1401 bool _get(std::vector<T> &ps,
const std::string &name =
"")
1413 virtual bool clear(
const std::string &name =
"")
1419 virtual bool set(
const string &p) {
return _set(p); }
1420 virtual bool get(std::vector<number> &ps,
const std::string &name =
"")
1422 return _get(ps, name);
1424 virtual bool get(std::vector<string> &ps,
const std::string &name =
"")
1426 return _get(ps, name);
1430 std::vector<number> ps;
1432 std::vector<double> choices;
1433 if(ps.size()) choices = ps[0].getChoices();
1434 choices.insert(choices.end(), p.
getChoices().begin(),
1442 std::vector<string> ps;
1444 std::vector<std::string> choices;
1445 if(ps.size()) choices = ps[0].getChoices();
1446 choices.insert(choices.end(), p.
getChoices().begin(),
1453 const std::string &name =
"")
1455 bool ret =
_get(ps, name);
1456 for(std::size_t i = 0; i < ps.size(); i++)
1457 ps[i].setChoices(std::vector<double>());
1461 const std::string &name =
"")
1463 bool ret =
_get(ps, name);
1464 for(std::size_t i = 0; i < ps.size(); i++)
1465 ps[i].setChoices(std::vector<std::string>());
1490 const std::string &remoteLogin =
"",
1527 template <
class T>
bool _set(
const T &p,
bool withChoices =
true)
1530 std::string msg = p.toChar();
1534 (
int)msg.size(), &msg[0]);
1538 bool _get(std::vector<T> &ps,
const std::string &name =
"",
1539 bool withChoices =
true)
1544 std::string msg = p.toChar();
1549 (
int)msg.size(), &msg[0]);
1552 (
int)msg.size(), &msg[0]);
1568 "Did not receive message header: aborting remote get");
1571 std::string msg(
length,
' ');
1574 "Did not receive message body: aborting remote get");
1625 "Did not receive message header: aborting wait on subclients");
1628 std::string msg(
length,
' ');
1631 "Did not receive message body: aborting wait on subclients");
1640 const std::string &serverAddress)
1664 virtual bool clear(
const std::string &name =
"")
1667 std::string msg = name;
1668 if(msg.empty()) msg =
"*";
1670 (
int)msg.size(), &msg[0]);
1674 virtual bool set(
const string &p) {
return _set(p); }
1675 virtual bool get(std::vector<number> &ps,
const std::string &name =
"")
1677 return _get(ps, name);
1679 virtual bool get(std::vector<string> &ps,
const std::string &name =
"")
1681 return _get(ps, name);
1688 return _set(p,
false);
1693 return _set(p,
false);
1696 const std::string &name =
"")
1698 return _get(ps, name,
false);
1701 const std::string &name =
"")
1703 return _get(ps, name,
false);
1734 const std::string &command)
1736 #if !defined(BUILD_IOS)
1738 int res = system(command.c_str());
bool fromJSON(const std::string &json)
std::string sanitize(const std::string &in) const
std::string toChar() const
bool set(const number &p, const std::string &client="")
static server * instance(const std::string &address="")
virtual void sendVertexArray(const std::string &msg)
std::string getValueLabel(double value) const
std::string toChar() const
bool _treatExecutableAsFullCommandLine
virtual bool setAndAppendChoices(const number &p)
void setValue(const std::string &value)
void addClients(const std::map< std::string, int > &clients)
static bool fromFile(std::vector< std::string > &msg, FILE *fp)
void SendMessage(int type, int length, const void *msg)
virtual bool getWithoutChoices(std::vector< string > &ps, const std::string &name="")=0
void sendWarning(const std::string &msg)
bool set(const string &p, const std::string &client="")
static bool toFile(const std::vector< std::string > &msg, FILE *fp, const std::string &creator)
server(const std::string &address="")
static void getInfoFromChar(const std::string &msg, std::string &version, std::string &type, std::string &name)
void getAllParameters(std::set< parameter *, parameterLessThan > &ps) const
void Warning(const char *str)
std::vector< value > array
std::string toJSON() const
std::string::size_type fromChar(const std::string &msg)
virtual bool getWithoutChoices(std::vector< number > &ps, const std::string &name="")
void sendParseStringRequest(const std::string &msg)
void setLabel(const std::string &label)
void setValueLabel(double value, const std::string &label)
int ReceiveHeader(int *type, int *len, int *swap)
virtual bool fromJSON(const picojson::value::object &par)
void thresholdChanged(int value, const std::string &client="")
void thresholdChanged(int threshold, const std::string &client="")
virtual bool isNetworkClient()
void clear(const std::string &name="", const std::string &client="")
void runSubClient(const std::string &name, const std::string &command)
bool hasClient(const std::string &client) const
void setStep(double step)
std::vector< std::string > _values
virtual bool set(const number &p)
bool get(std::vector< number > &ps, const std::string &name="", const std::string &client="")
virtual bool get(std::vector< number > &ps, const std::string &name="")=0
virtual bool set(const string &p)
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
std::vector< double > _values
number(const std::string &name, const std::vector< double > &values, const std::string &label="", const std::string &help="")
@ GMSH_PARAMETER_QUERY_ALL
void setGmshServer(GmshServer *server)
void ParseString(const char *str)
virtual std::string toJSON() const
client(const std::string &name)
static std::string version()
const std::string & getRemoteLogin()
bool operator()(const parameter *p1, const parameter *p2) const
const std::vector< double > & getValues() const
std::string getType() const
std::map< std::string, int > _clients
void setKind(const std::string &kind)
void update(const number &p)
void setVisible(bool visible)
std::string getShortName() const
static std::string getNextToken(const std::string &msg, std::string::size_type &first, char separator=charSep())
void MergeFile(const char *str)
void setNeverChanged(bool never)
void setValues(const std::vector< std::string > &values)
bool fromJSON(const std::string &json, const std::string &client="")
int getChangedValue() const
virtual void sendError(const std::string &msg)
void registerClient(client *c)
const std::string & getValue() const
bool fromJSON(const picojson::value::object &par, const std::string &client="")
static void setInstance(server *s)
virtual bool get(std::vector< string > &ps, const std::string &name="")=0
const std::string & getName() const
const std::map< std::string, std::string > & getAttributes() const
int ReceiveMessage(int len, void *buffer)
bool _clear(const std::string &name, const std::string &client, std::set< T *, parameterLessThan > &ps)
virtual bool set(const number &p)=0
static double maxNumber()
const std::map< double, std::string > & getValueLabels() const
std::set< string *, parameterLessThan > _strings
const std::map< std::string, int > & getClients() const
std::string::size_type fromChar(const std::string &msg)
number(const std::string &name="", double value=0., const std::string &label="", const std::string &help="")
virtual void sendInfo(const std::string &msg)
bool _get(std::vector< T > &p, const std::string &name, const std::string &client, std::set< T *, parameterLessThan > &ps)
virtual bool setAndAppendChoices(const number &p)
bool _get(std::vector< T > &ps, const std::string &name="", bool withChoices=true)
virtual bool clear(const std::string &name="")
void setValueLabels(const std::map< double, std::string > &valueLabels)
std::string getPath() const
const std::string & getHelp() const
bool get(std::vector< T > &ps, const std::string &name="", const std::string &client="")
void setSocketSwitch(const std::string &s)
static int defaultChangedValue()
virtual bool getWithoutChoices(std::vector< string > &ps, const std::string &name="")
const std::string & getSocketSwitch()
@ GMSH_PARAMETER_QUERY_END
void update(const string &p)
virtual bool setAndAppendChoices(const string &p)=0
T * _getPtr(std::string name, const std::string client, std::set< T *, parameterLessThan > ps)
parameterSpace _parameterSpace
const std::string & getKind() const
parameter(const std::string &name="", const std::string &label="", const std::string &help="")
void OpenProject(const char *str)
string(const std::string &name, const std::vector< std::string > &values, const std::string &label="", const std::string &help="")
virtual ~remoteNetworkClient()
int getChanged(const std::string &client="")
void getParameterNames(std::vector< std::string > &names, const std::string &search="") const
citer findClient(const std::string &name)
virtual bool getWithoutChoices(std::vector< number > &ps, const std::string &name="")=0
std::string getValueAsString() const
virtual bool get(std::vector< number > &ps, const std::string &name="")
virtual bool get(std::vector< string > &ps, const std::string &name="")
std::set< client * > _clients
void setChanged(int changed, const std::string &client="")
const std::vector< std::string > & getChoices() const
void sendError(const std::string &msg)
std::vector< std::string > toChar(const std::string &client="")
std::set< client * >::iterator citer
void swap(double &a, double &b)
void setChoiceLabels(const std::vector< std::string > &labels)
bool _get(std::vector< T > &ps, const std::string &name="")
bool getNeverChanged() const
void setHelp(const std::string &help)
virtual bool getWithoutChoices(std::vector< string > &ps, const std::string &name="")
bool fromJSON(const picojson::value::object &par)
virtual bool clear(const std::string &name="")
void getParameterNames(std::vector< std::string > &names, const std::string &search="") const
std::string toJSON() const
std::map< double, std::string > _valueLabels
virtual bool get(std::vector< string > &ps, const std::string &name="")
void clear(const std::string &name="", const std::string &client="")
int Connect(const char *sockname)
void Info(const char *str)
std::string parse(value &out, Iter &pos, const Iter &last)
std::map< std::string, value > object
static std::string trim(const std::string &str, const std::string &whitespace=" \t\n")
void addClient(const std::string &client, int changed)
void setChanged(int changed, const std::string &client="")
bool _set(const T &p, bool withChoices=true)
virtual bool isNetworkClient()
bool fromChar(const std::vector< std::string > &msg, const std::string &client="")
std::vector< std::string > toChar()
int getChanged(const std::string &client="") const
void setExecutable(const std::string &s)
virtual ~localNetworkClient()
void setAttributes(const std::map< std::string, std::string > &attributes)
virtual bool isNetworkClient()
virtual void sendProgress(const std::string &msg)
bool toFile(FILE *fp, const std::string &client="")
bool get(std::vector< string > &ps, const std::string &name="", const std::string &client="")
int Select(int seconds, int microseconds, int socket=-1)
virtual bool clear(const std::string &name)=0
void setAttribute(const std::string &key, const std::string &value)
virtual void sendOpenProjectRequest(const std::string &msg)
bool _set(const T &p, const std::string &client, std::set< T *, parameterLessThan > &ps)
std::string getType() const
bool fromChar(const std::vector< std::string > &msg)
void Progress(const char *str)
void setReadOnly(bool readOnly)
void sendOpenProjectRequest(const std::string &msg)
double length(Quaternion &q)
std::string _serverAddress
virtual void sendMergeFileRequest(const std::string &msg)
@ GMSH_PARAMETER_NOT_FOUND
std::string getValueAsString() const
virtual bool setAndAppendChoices(const string &p)
void setValue(double value)
@ GMSH_PARAMETER_QUERY_WITHOUT_CHOICES
remoteNetworkClient(const std::string &name, const std::string &serverAddress)
bool toJSON(std::string &json, const std::string &client="")
bool fromJSON(const std::string &json, const std::string &client="")
void setRemoteLogin(const std::string &s)
GmshClient * getGmshClient()
virtual void sendParseStringRequest(const std::string &msg)
string(const std::string &name="", const std::string &value="", const std::string &label="", const std::string &help="")
bool fromJSON(const picojson::value::object &par)
void setClients(const std::map< std::string, int > &clients)
virtual void sendWarning(const std::string &msg)
virtual bool setAndAppendChoices(const number &p)=0
virtual std::string toChar() const
std::map< std::string, std::string > _attributes
void sendMergeFileRequest(const std::string &msg)
bool fromFile(FILE *fp, const std::string &client="")
static std::vector< std::string > split(const std::string &msg, char separator=charSep())
void runNonBlockingSubClient(const std::string &name, const std::string &command)
virtual bool set(const string &p)=0
void setName(const std::string &name)
const std::vector< std::string > & getValues() const
const std::string & getLabel() const
std::vector< double > _choices
localNetworkClient(const std::string &name, const std::string &executable, const std::string &remoteLogin="", bool treatExecutableAsFullCommandLine=false)
bool treatExecutableAsFullCommandLine() const
bool toJSON(std::string &json, const std::string &creator="", const std::string &client="") const
void setChoices(const std::vector< std::string > &choices)
virtual std::string::size_type fromChar(const std::string &msg)
bool fromJSON(const std::string &json)
void sendInfo(const std::string &msg)
std::string sanitizeJSON(const std::string &in) const
std::set< number *, parameterLessThan > _numbers
@ GMSH_PARAMETER_WITHOUT_CHOICES
void getPtr(number **ptr, const std::string &name, const std::string &client="")
void setChangedValue(int value)
bool fromChar(const std::vector< std::string > &msg, const std::string &client="")
virtual std::string getType() const =0
std::string getAttribute(const std::string &key) const
void setValues(const std::vector< double > &values)
localClient(const std::string &name)
virtual bool get(std::vector< number > &ps, const std::string &name="")
GmshServer * getGmshServer()
std::vector< std::string > toChar(const std::string &client="") const
void sendProgress(const std::string &msg)
virtual bool getWithoutChoices(std::vector< number > &ps, const std::string &name="")
bool set(const T &p, const std::string &client="")
int getChanged(const std::string &client="") const
virtual bool set(const number &p)
const std::vector< double > & getChoices() const
const std::string & getExecutable()
void getPtr(string **ptr, const std::string &name, const std::string &client="")
void Error(const char *str)
bool hasClient(const std::string &client)
virtual bool setAndAppendChoices(const string &p)
void setChanged(int changed, const std::string &client="")
void unregisterClient(client *c)
std::vector< std::string > _choices
std::string _socketSwitch
virtual bool set(const string &p)
void setChoices(const std::vector< double > &choices)