本文整理汇总了C++中poco::SharedPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ SharedPtr::get方法的具体用法?C++ SharedPtr::get怎么用?C++ SharedPtr::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poco::SharedPtr
的用法示例。
在下文中一共展示了SharedPtr::get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createConnection
ConnectionBasePtr TransferNode::createConnection(const PacketBasePtr &packet_base, const EndPoint &ep) {
PacketHeader::PACKET_ID_TYPE packet_id = packet_base->header.getPacketID();
if (packet_id == OpenConnection_ID) {
INFO_LOG("Server: new connection from: " << ep.toString());
Poco::SharedPtr<OpenConnectionPacket> packet = packet_base.cast<OpenConnectionPacket>();
assert(packet.get());
ConnectionBasePtr pConn(new ServerConnection(packet->OpenConnection.Code, ep, this->packet_serializer, *this));
return pConn;
} else if (packet_id == OpenConnectionReply_ID) {
INFO_LOG("Client: new connection to: " << ep.toString());
Poco::SharedPtr<OpenConnectionReplyPacket> packet = packet_base.cast<OpenConnectionReplyPacket>();
ConnectionBasePtr pConn(new ClientConnection(packet->OpenConnectionReply.Code, ep, this->packet_serializer, *this));
return pConn;
} else {
throw Poco::ApplicationException("unexpected packet type: ", packet_base->header.getPacketID()); // TODO @@@ ???
}
}