当前位置: 首页>>代码示例>>C++>>正文


C++ Assignment::getCommand方法代码示例

本文整理汇总了C++中Assignment::getCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ Assignment::getCommand方法的具体用法?C++ Assignment::getCommand怎么用?C++ Assignment::getCommand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assignment的用法示例。


在下文中一共展示了Assignment::getCommand方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sendAssignment

void NodeList::sendAssignment(Assignment& assignment) {
 
    PacketType assignmentPacketType = assignment.getCommand() == Assignment::CreateCommand
        ? PacketType::CreateAssignment
        : PacketType::RequestAssignment;

    auto assignmentPacket = NLPacket::create(assignmentPacketType);
    
    QDataStream packetStream(assignmentPacket.get());
    packetStream << assignment;
    
    sendPacket(std::move(assignmentPacket), _assignmentServerSocket);
}
开发者ID:JamesLinus,项目名称:hifi,代码行数:13,代码来源:NodeList.cpp

示例2: sendAssignment

void NodeList::sendAssignment(Assignment& assignment) {
    
    PacketType assignmentPacketType = assignment.getCommand() == Assignment::CreateCommand
        ? PacketTypeCreateAssignment
        : PacketTypeRequestAssignment;
    
    QByteArray packet = byteArrayWithPopulatedHeader(assignmentPacketType);
    QDataStream packetStream(&packet, QIODevice::Append);
    
    packetStream << assignment;

    _nodeSocket.writeDatagram(packet, _assignmentServerSocket.getAddress(), _assignmentServerSocket.getPort());
}
开发者ID:VR-cdrone,项目名称:hifi,代码行数:13,代码来源:NodeList.cpp

示例3: sendAssignment

void NodeList::sendAssignment(Assignment& assignment) {
    unsigned char assignmentPacket[MAX_PACKET_SIZE];
    
    PACKET_TYPE assignmentPacketType = assignment.getCommand() == Assignment::CreateCommand
        ? PACKET_TYPE_CREATE_ASSIGNMENT
        : PACKET_TYPE_REQUEST_ASSIGNMENT;
    
    int numHeaderBytes = populateTypeAndVersion(assignmentPacket, assignmentPacketType);
    int numAssignmentBytes = assignment.packToBuffer(assignmentPacket + numHeaderBytes);
    
    sockaddr* assignmentServerSocket = (_assignmentServerSocket == NULL)
        ? (sockaddr*) &DEFAULT_LOCAL_ASSIGNMENT_SOCKET
        : _assignmentServerSocket;
    
    _nodeSocket.send(assignmentServerSocket, assignmentPacket, numHeaderBytes + numAssignmentBytes);
}
开发者ID:problem,项目名称:hifi,代码行数:16,代码来源:NodeList.cpp


注:本文中的Assignment::getCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。