Exemplo n.º 1
0
 void Member::readData(serialization::ObjectDataInput &reader) {
     address.readData(reader);
     uuid = *reader.readUTF();
     liteMember = reader.readBoolean();
     int size = reader.readInt();
     for (int i = 0; i < size; i++) {
         std::auto_ptr<std::string> key = reader.readUTF();
         byte readByte = reader.readByte();
         if (readByte == util::IOUtil::PRIMITIVE_TYPE_BOOLEAN) {
             boolAttributes[*key] = reader.readBoolean();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_BYTE) {
             byteAttributes[*key] = reader.readByte();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_DOUBLE) {
             doubleAttributes[*key] = reader.readDouble();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_FLOAT) {
             floatAttributes[*key] = reader.readFloat();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_INTEGER) {
             intAttributes[*key] = reader.readInt();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_LONG) {
             longAttributes[*key] = reader.readLong();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_SHORT) {
             shortAttributes[*key] = reader.readShort();
         } else if (readByte == util::IOUtil::PRIMITIVE_TYPE_UTF) {
             stringAttributes[*key] = *reader.readUTF();
         }
     }
 }
 void ClientMembershipEvent::readData(serialization::ObjectDataInput &reader) {
     member.readData(reader);
     int t = reader.readInt();
     if (t == MembershipEvent::MEMBER_ADDED) {
         eventType = MembershipEvent::MEMBER_ADDED;
     } else if (t == MembershipEvent::MEMBER_REMOVED) {
         eventType = MembershipEvent::MEMBER_REMOVED;
     } else if (t == MembershipEvent::MEMBER_ATTRIBUTE_CHANGED) {
         eventType = MembershipEvent::MEMBER_ATTRIBUTE_CHANGED;
     }
     if (reader.readBoolean()) {
         memberAttributeChange.reset(new impl::MemberAttributeChange());
         memberAttributeChange->readData(reader);
     }
 }