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


C++ ConnectionWriter::appendInt方法代码示例

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


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

示例1: write

bool Stamp::write(ConnectionWriter& connection) {
    connection.appendInt(BOTTLE_TAG_LIST); // nested structure
    connection.appendInt(2);               // with two elements
    connection.appendInt(BOTTLE_TAG_INT);
    connection.appendInt(sequenceNumber);
    connection.appendInt(BOTTLE_TAG_DOUBLE);
    connection.appendDouble(timeStamp);
    connection.convertTextMode();
    return !connection.isError();
}
开发者ID:paulfitz,项目名称:yarp,代码行数:10,代码来源:Stamp.cpp

示例2: write

bool Value::write(ConnectionWriter& connection) {
    if (!proxy) {
        connection.appendInt(BOTTLE_TAG_LIST);
        connection.appendInt(0);
        return !connection.isError();
    }
    connection.appendInt(BOTTLE_TAG_LIST);
    connection.appendInt(1);
    return proxy->write(connection);
}
开发者ID:johnty,项目名称:libYARP_OS,代码行数:10,代码来源:Value.cpp

示例3: write

bool BottleImpl::write(ConnectionWriter& writer) {
    // could simplify this if knew lengths of blocks up front
    if (writer.isTextMode()) {
        //writer.appendLine(toString());
        writer.appendString(toString().c_str(),'\n');
    } else {
#ifdef USE_YARP1_PREFIX
        if (!nested) {
            String name = "YARP2";
            writer.appendInt(name.length()+1);
            writer.appendString(name.c_str(),'\0');
        }
#endif
        synch();
        /*
          if (!nested) {
          // No byte count any more, to facilitate nesting
          //YMSG(("bottle byte count %d\n",byteCount()));
          //writer.appendInt(byteCount()+sizeof(NetInt32));
          
          writer.appendInt(StoreList::code + speciality);
          }
        */
        //writer.appendBlockCopy(Bytes((char*)getBytes(),byteCount()));
        writer.appendBlock((char*)getBytes(),byteCount());
    }
    return !writer.isError();
}
开发者ID:holgerfriedrich,项目名称:yarp,代码行数:28,代码来源:BottleImpl.cpp

示例4: write

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//~~~~~~~~~~~~~~~~~~~~~~
//   SERIALIZATION methods
//~~~~~~~~~~~~~~~~~~~~~~
bool dynContact::write(ConnectionWriter& connection) const{
    // represent a dynContact as a list of 4 elements that are:
    // - a list of 3 int, i.e. contactId, bodyPart, linkNumber
    // - a list of 3 double, i.e. the CoP
    // - a list of 3 double, i.e. the force
    // - a list of 3 double, i.e. the moment

    connection.appendInt(BOTTLE_TAG_LIST);
    connection.appendInt(4);
    // list of 3 int, i.e. contactId, bodyPart, linkNumber
    connection.appendInt(BOTTLE_TAG_LIST + BOTTLE_TAG_INT);
    connection.appendInt(3);
    connection.appendInt(contactId);
    connection.appendInt(bodyPart);    // left_arm, right_arm, ...
    connection.appendInt(linkNumber);
    // list of 3 double, i.e. the CoP
    connection.appendInt(BOTTLE_TAG_LIST + BOTTLE_TAG_DOUBLE);
    connection.appendInt(3);
    for(int i=0;i<3;i++) connection.appendDouble(CoP[i]);
    // list of 3 double, i.e. the force
    connection.appendInt(BOTTLE_TAG_LIST + BOTTLE_TAG_DOUBLE);
    connection.appendInt(3);
    for(int i=0;i<3;i++) connection.appendDouble(F[i]);
    // list of 3 double, i.e. the moment
    connection.appendInt(BOTTLE_TAG_LIST + BOTTLE_TAG_DOUBLE);
    connection.appendInt(3);
    for(int i=0;i<3;i++) connection.appendDouble(Mu[i]);  

    // if someone is foolish enough to connect in text mode,
    // let them see something readable.
    connection.convertTextMode();  
    
    return !connection.isError();
}
开发者ID:robotology,项目名称:icub-main,代码行数:38,代码来源:dynContact.cpp

示例5: writeRaw

bool StoreBlob::writeRaw(ConnectionWriter& writer) {
    writer.appendInt((int)x.length());
    writer.appendBlock(x.c_str(),x.length());
    return true;
}
开发者ID:holgerfriedrich,项目名称:yarp,代码行数:5,代码来源:BottleImpl.cpp

示例6: write

 virtual bool write(ConnectionWriter& connection) {
     printf("Writing an integer\n");
     connection.appendInt(val);
     return true;
 }
开发者ID:Tiger66639,项目名称:yarp,代码行数:5,代码来源:yarpcxx_test2.cpp


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