Esempio n. 1
0
	void load(T*& x, AccessByNameID<boost::intrusive_ptr<U> >* byid)
	{
		typename T::SFINAE_ro_self_t* for_check = 0;
		(void)(for_check);
		var_size_t objid;
		*p >> objid;
		std::string err;
		if (!byid->check_id(objid.t, T::s_getClassName(), err)) {
			throw rpc_exception(err);
		}
		U* y = byid->get_rawptr_byid(objid.t);
		x = dynamic_cast<T*>(y);
		if (0 == x)
			incompitible_class_cast(y, T::s_getClassName());
	}
Esempio n. 2
0
	void read_header(Input& input, const AccessByNameID<server_stub_i*>& stubs) {
		stub = 0;
		var_size_t vint, callid;
		input >> vint >> callid;
		this->seqid = vint.t;
		if (0 == callid.t) { // call by name
			std::string funName;
			input >> funName;
			stub = stubs.get_byname(funName);
			if (0 == stub) {
				string_appender<> oss;
				oss << "can not find function [name=\"" << funName << "\" to call";
				throw rpc_exception(oss.str());
			}
			isbyid = false;
		}