static pbuffer::AttributeValue ParseFromAttributeValue()

in GomokuServer/GomokuServer/include/aws/gamelift/internal/modelmapper/AttributeValueMapper.h [73:117]


        static pbuffer::AttributeValue ParseFromAttributeValue(const AttributeValue &attrValue)
        {
            AttributeValue::AttrType type = attrValue.GetType();
            pbuffer::AttributeValue event;
            event.set_type(static_cast<int>(type));

            switch (type)
            {
            case AttributeValue::AttrType::STRING:
            {
                event.set_s(attrValue.GetS());
                break;
            }

            case AttributeValue::AttrType::STRING_LIST:
            {
                int count;
                const AttributeValue::AttributeStringType* strs = attrValue.GetSL(count);
                for (int index = 0; index < count; ++index)
                {
                    event.add_sl(strs[index]);
                }
                break;
            }

            case AttributeValue::AttrType::STRING_DOUBLE_MAP:
            {
                int count;
                const AttributeValue::KeyAndValue* entries = attrValue.GetSDM(count);
                for (int index = 0; index < count; ++index)
                {
                    (*event.mutable_sdm())[entries[index].GetKey()] = entries[index].GetValue();
                }
                break;
            }

            default:
            {
                event.set_n(attrValue.GetN());
                break;
            }
            }

            return event;
        }