2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You hay obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __CONTEXT_TUPLE_H__
18 #define __CONTEXT_TUPLE_H__
22 #include <ContextTypes.h>
26 class EXPORT_API Tuple {
30 bool getAt(unsigned int idx, int64_t* val);
31 bool getAt(unsigned int idx, double* val);
32 bool getAt(unsigned int idx, std::string* val);
34 static Tuple* duplicate(Tuple& tuple);
36 static GVariant* toGVariant(Tuple* tuple);
37 static GVariant* toGVariant(std::vector<Tuple*>& tuples);
39 static std::vector<Tuple*> buildFrom(GVariant* gVar);
42 Tuple(GVariant* gVar);
45 bool __verify(unsigned int idx, const GVariantType* type);
48 GVariant** __elements;
57 Builder& add(int64_t val);
58 Builder& add(double val);
59 Builder& add(const std::string& val);
66 GVariantBuilder* __gvBuilder;