MCPcopy Create free account
hub / github.com/dmlc/dmlc-core / Set

Method Set

include/dmlc/parameter.h:609–630  ·  view source on GitHub ↗

implement set value

Source from the content-addressed store, hash-verified

607 typedef TEntry EntryType;
608 // implement set value
609 void Set(void *head, const std::string &value) const override {
610 std::istringstream is(value);
611 is >> this->Get(head);
612 if (!is.fail()) {
613 while (!is.eof()) {
614 int ch = is.get();
615 if (ch == EOF) {
616 is.clear(); break;
617 }
618 if (!isspace(ch)) {
619 is.setstate(std::ios::failbit); break;
620 }
621 }
622 }
623
624 if (is.fail()) {
625 std::ostringstream os;
626 os << "Invalid Parameter format for " << key_
627 << " expect " << type_ << " but value=\'" << value<< '\'';
628 throw dmlc::ParamError(os.str());
629 }
630 }
631
632 std::string GetStringValue(void *head) const override {
633 std::ostringstream os;

Callers 2

RunUpdateMethod · 0.45
GetEnvFunction · 0.45

Calls 6

isspaceFunction · 0.85
ParamErrorClass · 0.85
clearMethod · 0.80
GetMethod · 0.45
getMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected