本文整理汇总了C++中RoutableMessageHeader::set_source_object方法的典型用法代码示例。如果您正苦于以下问题:C++ RoutableMessageHeader::set_source_object方法的具体用法?C++ RoutableMessageHeader::set_source_object怎么用?C++ RoutableMessageHeader::set_source_object使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoutableMessageHeader
的用法示例。
在下文中一共展示了RoutableMessageHeader::set_source_object方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processMessage
void Space::processMessage(const ObjectReference*ref,MemoryReference message){
RoutableMessageHeader hdr;
MemoryReference message_body=hdr.ParseFromArray(message.data(),message.size());
if (!hdr.has_source_object()&&ref) {
hdr.set_source_object(*ref);
}
this->processMessage(hdr,message_body);
}
示例2: addressMessage
virtual DidAlterMessage addressMessage(RoutableMessageHeader&output,
const ObjectReference*source,
const ObjectReference*destination) {
return UNSPOILED_MESSAGE;
if (0) {//you might want to do this if you are a forwarding class or something more advanced
if (source)
output.set_source_object(*source);
if (destination)
output.set_destination_object(*destination);
}
}
示例3: go
void go() {
mSuccess = false;
Persistence::Protocol::ReadWriteSet rws;
Persistence::Protocol::IStorageElement el = rws.add_reads();
el.set_field_name("ObjectList");
// el.set_object_uuid(UUID::null());
// el.set_field_id(0);
RoutableMessageHeader hdr;
hdr.set_source_object(ObjectReference::spaceServiceID());
hdr.set_source_port(mPort);
hdr.set_destination_port(Services::PERSISTENCE);
hdr.set_destination_object(ObjectReference::spaceServiceID());
std::string body;
rws.SerializeToString(&body);
mObjectHost->processMessage(hdr, MemoryReference(body));
}
示例4: timedOut
void timedOut(const boost::system::error_code &error) {
std::auto_ptr<TimerHandler> scopedDestructor(this);
if (error == boost::asio::error::operation_aborted) {
return; // don't care if the timer was cancelled.
}
RoutableMessageHeader msg;
if (mSentMessage->header().has_destination_object()) {
msg.set_source_object(mSentMessage->header().destination_object());
}
if (mSentMessage->header().has_destination_space()) {
msg.set_source_space(mSentMessage->header().destination_space());
}
msg.set_source_port(mSentMessage->header().destination_port());
msg.set_return_status(RoutableMessageHeader::TIMEOUT_FAILURE);
msg.set_reply_id(mSentMessage->getId());
mSentMessage->mTimerHandle=NULL;
mSentMessage->mResponseCallback(mSentMessage, msg, MemoryReference(NULL,0));
//formerly called this, but that asked asio to unset an ignored callback mSentMessage->processMessage(msg, MemoryReference(NULL,0));
}