2 //******************************************************************
4 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
6 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
12 // http://www.apache.org/licenses/LICENSE-2.0
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
20 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 /// @file AttributeValue.h
24 /// @brief This file contains the definition of the internally used
25 // type AttributeValue
27 #ifndef __ATTRIBUTEVALUE_H
28 #define __ATTRIBUTEVALUE_H
30 // These defines are required to get the boost::variant to hold more than 20 items.
31 // documentation requires that you use a power of 10
32 #define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
33 #define BOOST_MPL_LIMIT_LIST_SIZE 30
34 #define BOOST_MPL_LIMIT_VECTOR_SIZE 30
35 #include <boost/variant.hpp>
39 class OCRepresentation;
42 // Since null needs to be encoded in a special fashion in JSON, the encoder
43 // needs to know the index of the NullType Sentinel Any time the code does a special
44 // case for the NullType, we use the AttributeValueNullIndex. This MUST be kept up to date
45 // with the variant's which() for NullType.
46 static const int AttributeValueNullIndex = 0;
47 typedef boost::variant<
50 NullType, // Note: this handles the null-type and must match the above static const
61 std::vector<std::string>,
62 std::vector<OC::OCRepresentation>,
65 std::vector<std::vector<int>>,
66 std::vector<std::vector<std::vector<int>>>,
68 std::vector<std::vector<double>>,
69 std::vector<std::vector<std::vector<double>>>,
71 std::vector<std::vector<bool>>,
72 std::vector<std::vector<std::vector<bool>>>,
74 std::vector<std::vector<std::string>>,
75 std::vector<std::vector<std::vector<std::string>>>,
77 std::vector<std::vector<OC::OCRepresentation>>,
78 std::vector<std::vector<std::vector<OC::OCRepresentation>>>
82 #endif // __ATTRIBUTEVALUE_H