コード例 #1
0
        OC::OCRepresentation build(const SimulatorResourceModel &model)
        {
            OC::OCRepresentation ocRep;
            for (auto &element : model.getAttributeValues())
            {
                ValueConverter visitor(ocRep, element.first);
                boost::apply_visitor(visitor, element.second);
            }

            return std::move(ocRep);
        }
コード例 #2
0
                void operator ()(const SimulatorResourceModel &value)
                {
                    OC::OCRepresentation ocRep;
                    for (auto &element : value.getAttributeValues())
                    {
                        ValueConverter visitor(ocRep, element.first);
                        boost::apply_visitor(visitor, element.second);
                    }

                    m_rep.setValue(m_name, ocRep);
                }
コード例 #3
0
                std::string operator ()(const SimulatorResourceModel &value)
                {
                    std::ostringstream out;
                    out << "{ ";
                    for (auto &element : value.getAttributeValues())
                    {
                        out << "\"" << element.first << "\" : ";

                        ValueVisitor visitor;
                        out << boost::apply_visitor(visitor, element.second);

                        out << ", ";
                    }
                    out << "}";
                    return out.str();
                }