예제 #1
0
bool StoreBlob::readRaw(ConnectionReader& reader)
{
    std::int32_t len = reader.expectInt32();
    x.resize(len);
    reader.expectBlock(const_cast<char*>(x.data()), len);
    return true;
}
예제 #2
0
bool Storable::read(ConnectionReader& connection)
{
    std::int32_t x = connection.expectInt32();
    if (x != getCode()) {
        return false;
    }
    return readRaw(connection);
}
예제 #3
0
파일: Value.cpp 프로젝트: ale-git/yarp
bool Value::read(ConnectionReader& connection)
{
    if (proxy) {
        delete proxy;
        proxy = nullptr;
    }
    std::int32_t x = connection.expectInt32();
    if ((x&0xffff) != x) return false;
    if (!(x&BOTTLE_TAG_LIST)) return false;
    std::int32_t len = connection.expectInt32();
    if (len==0) return true;
    if (len!=1) return false;
    if (x==BOTTLE_TAG_LIST) {
        x = connection.expectInt32();
    } else {
        x &= ~BOTTLE_TAG_LIST;
    }
    if (connection.isError()) return false;
    Storable *s = Storable::createByCode(x);
    setProxy(s);
    if (!proxy) return false;
    return s->readRaw(connection);
}
예제 #4
0
bool StoreString::readRaw(ConnectionReader& reader)
{
    std::int32_t len = reader.expectInt32();
    x.resize(len);
    reader.expectBlock(const_cast<char*>(x.data()), len);
#ifndef YARP_NO_DEPRECATED // Since YARP 2.3.72
    // This is needed for compatibility with versions of yarp before March 2015
    if (len > 0) {
        if (x[len - 1] == '\0') {
            x.resize(len-1);
        }
    }
#endif // YARP_NO_DEPRECATED
    return true;
}
예제 #5
0
bool StoreVocab::readRaw(ConnectionReader& reader)
{
    x = reader.expectInt32();
    return true;
}