#ifndef __CONTEXT_STORE_H__
#define __CONTEXT_STORE_H__
+#include <vector>
+#include <Tuple.h>
#include <ContextStoreTypes.h>
+#include <ContextStoreSearchQuery.h>
-#ifdef __cplusplus
-extern "C"
-{
-#endif
+namespace ctx {
-/* TEST CODE */
-int context_store_test();
+ class EXPORT_API ContextStore {
+ public:
+ virtual ~ContextStore();
+
+ virtual int insert(const std::vector<std::string>& columns, Tuple& record);
+ virtual int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
+ virtual int retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result);
+ virtual int remove(const std::string& selection);
+
+ protected:
+ ContextStore();
+ };
-#ifdef __cplusplus
}
-#endif
-#endif
+#endif /* __CONTEXT_STORE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_MANAGER_H__
+#define __CONTEXT_STORE_MANAGER_H__
+
+#include <string>
+#include <ContextStoreTypes.h>
+#include <ContextStore.h>
+
+namespace ctx {
+
+ class EXPORT_API ContextStoreManager {
+ public:
+ ContextStoreManager();
+ ~ContextStoreManager();
+
+ int getStore(const std::string& uri, ContextStore** contextStore);
+ int removeStore(const std::string& uri);
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_MANAGER_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_SEARCH_QUERY_H__
+#define __CONTEXT_STORE_SEARCH_QUERY_H__
+
+#include <string>
+#include <ContextStoreTypes.h>
+
+namespace ctx {
+
+ class EXPORT_API ContextStoreSearchQuery {
+ public:
+ ContextStoreSearchQuery();
+ ContextStoreSearchQuery(
+ const std::string& projection,
+ const std::string& selection,
+ const std::string& sortOrder,
+ unsigned int limit);
+
+ ~ContextStoreSearchQuery();
+
+ ContextStoreSearchQuery& setProjection(const std::string& projection);
+ ContextStoreSearchQuery& setSelection(const std::string& selection);
+ ContextStoreSearchQuery& setSortOrder(const std::string& sortOrder);
+ ContextStoreSearchQuery& setLimit(unsigned int limit);
+
+ bool valid();
+
+ private:
+ std::string __projection;
+ std::string __selection;
+ std::string __sortOrder;
+ unsigned int __limit;
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_SEARCH_QUERY_H__ */
using namespace ctx;
-/* TODO: Remove this test code */
-EXPORT_API int context_store_test()
+ContextStore::ContextStore()
+{
+}
+
+ContextStore::~ContextStore()
+{
+}
+
+int ContextStore::insert(const std::vector<std::string>& columns, Tuple& record)
+{
+ return E_SUPPORT;
+}
+
+int ContextStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
+{
+ return E_SUPPORT;
+}
+
+int ContextStore::retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result)
+{
+ return E_SUPPORT;
+}
+
+int ContextStore::remove(const std::string& selection)
{
return E_SUPPORT;
}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ContextStoreTypesPrivate.h>
+#include <ContextStoreManager.h>
+
+using namespace ctx;
+
+ContextStoreManager::ContextStoreManager()
+{
+}
+
+ContextStoreManager::~ContextStoreManager()
+{
+}
+
+int ContextStoreManager::getStore(const std::string& uri, ContextStore** store)
+{
+ return E_SUPPORT;
+}
+
+int ContextStoreManager::removeStore(const std::string& uri)
+{
+ return E_SUPPORT;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ContextStoreTypesPrivate.h>
+#include <ContextStoreSearchQuery.h>
+
+using namespace ctx;
+
+ContextStoreSearchQuery::ContextStoreSearchQuery() :
+ __limit(0)
+{
+}
+
+ContextStoreSearchQuery::ContextStoreSearchQuery(const std::string& projection,
+ const std::string& selection, const std::string& sortOrder,
+ unsigned int limit) :
+ __limit(0)
+{
+}
+
+ContextStoreSearchQuery::~ContextStoreSearchQuery()
+{
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setProjection(const std::string& projection)
+{
+ __projection = projection;
+ return *this;
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setSelection(const std::string& selection)
+{
+ __selection = selection;
+ return *this;
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setSortOrder(const std::string& sortOrder)
+{
+ __sortOrder = sortOrder;
+ return *this;
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setLimit(unsigned int limit)
+{
+ __limit = limit;
+ return *this;
+}
+
+bool ContextStoreSearchQuery::valid()
+{
+ return false;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "AppManagedLocalStore.h"
+
+using namespace ctx;
+
+AppManagedLocalStore::AppManagedLocalStore(ServiceProxy* proxy) :
+ AppManagedStore(proxy)
+{
+}
+
+AppManagedLocalStore::~AppManagedLocalStore()
+{
+}
+
+int AppManagedLocalStore::init(Schema& schema)
+{
+ //TODO
+ return E_SUPPORT;
+}
+
+int AppManagedLocalStore::insert(const std::vector<std::string>& columns, Tuple& record)
+{
+ //TODO
+ return E_SUPPORT;
+}
+
+int AppManagedLocalStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
+{
+ //TODO
+ return E_SUPPORT;
+}
+
+int AppManagedLocalStore::remove(const std::string& selection)
+{
+ //TODO
+ return E_SUPPORT;
+}
+
+int AppManagedLocalStore::destroy(const std::string& uri, ServiceProxy* proxy)
+{
+ //TODO
+ return E_NONE;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_APP_MANAGED_LOCAL_STORE_H__
+#define __CONTEXT_STORE_APP_MANAGED_LOCAL_STORE_H__
+
+#include <ServiceProxy.h>
+#include <ContextStore.h>
+#include <ContextStoreTypesPrivate.h>
+#include "AppManagedStore.h"
+#include "Schema.h"
+
+namespace ctx {
+
+ class AppManagedLocalStore : public AppManagedStore {
+ public:
+ AppManagedLocalStore(ServiceProxy* proxy);
+ ~AppManagedLocalStore();
+
+ int init(Schema& schema);
+
+ int insert(const std::vector<std::string>& columns, Tuple& record);
+ int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
+ int remove(const std::string& selection);
+
+ static int destroy(const std::string& uri, ServiceProxy* proxy);
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_APP_MANAGED_LOCAL_STORE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "AppManagedSharedStore.h"
+
+using namespace ctx;
+
+AppManagedSharedStore::AppManagedSharedStore(ServiceProxy* proxy) :
+ AppManagedStore(proxy)
+{
+}
+
+AppManagedSharedStore::~AppManagedSharedStore()
+{
+}
+
+int AppManagedSharedStore::init(Schema& schema)
+{
+ //TODO
+ return E_SUPPORT;
+}
+
+int AppManagedSharedStore::insert(const std::vector<std::string>& columns, Tuple& record)
+{
+ return E_PRIVIL;
+}
+
+int AppManagedSharedStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
+{
+ return E_PRIVIL;
+}
+
+int AppManagedSharedStore::remove(const std::string& selection)
+{
+ return E_PRIVIL;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_APP_MANAGED_SHARED_STORE_H__
+#define __CONTEXT_STORE_APP_MANAGED_SHARED_STORE_H__
+
+#include <ServiceProxy.h>
+#include <ContextStore.h>
+#include <ContextStoreTypesPrivate.h>
+#include "AppManagedStore.h"
+#include "Schema.h"
+
+namespace ctx {
+
+ class AppManagedSharedStore : public AppManagedStore {
+ public:
+ AppManagedSharedStore(ServiceProxy* proxy);
+ ~AppManagedSharedStore();
+
+ int init(Schema& schema);
+
+ int insert(const std::vector<std::string>& columns, Tuple& record);
+ int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
+ int remove(const std::string& selection);
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_APP_MANAGED_SHARED_STORE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "AppManagedStore.h"
+
+using namespace ctx;
+
+AppManagedStore::AppManagedStore(ServiceProxy* proxy) :
+ __proxy(proxy)
+{
+}
+
+AppManagedStore::~AppManagedStore()
+{
+}
+
+int AppManagedStore::retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result)
+{
+ // TODO
+ return E_SUPPORT;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_APP_MANAGED_STORE_H__
+#define __CONTEXT_STORE_APP_MANAGED_STORE_H__
+
+#include <ServiceProxy.h>
+#include <ContextStore.h>
+#include <ContextStoreTypesPrivate.h>
+#include "Schema.h"
+
+namespace ctx {
+
+ class AppManagedStore : public ContextStore {
+ public:
+ AppManagedStore(ServiceProxy* proxy);
+ virtual ~AppManagedStore();
+
+ int retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result);
+
+ private:
+ ServiceProxy* __proxy;
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_APP_MANAGED_STORE_H__ */
*/
#include <ContextStoreTypesPrivate.h>
-#include <ServiceProxy.h>
#include <ContextStore.h>
using namespace ctx;
-/* TODO: Remove this test code */
-EXPORT_API int context_store_test()
+ContextStore::ContextStore()
{
- // ServiceProxy object can be maintained as a static object.
- ServiceProxy proxy(CTX_CONTEXT_STORE);
+}
- GVariant* output = NULL;
+ContextStore::~ContextStore()
+{
+}
- int err = proxy.call("test", g_variant_new("(i)", 100), &output);
+int ContextStore::insert(const std::vector<std::string>& columns, Tuple& record)
+{
+ return E_SUPPORT;
+}
- _I(YELLOW("Return: %d (%s)"), err, CTX_ERROR_STR(err));
+int ContextStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
+{
+ return E_SUPPORT;
+}
- if (output)
- g_variant_unref(output);
+int ContextStore::retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result)
+{
+ return E_SUPPORT;
+}
- return err;
+int ContextStore::remove(const std::string& selection)
+{
+ return E_SUPPORT;
}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ServiceProxy.h>
+#include <IServiceResultListener.h>
+#include <IServiceSignalListener.h>
+#include <ContextStoreTypesPrivate.h>
+#include <ContextStoreManager.h>
+#include "SchemaConf.h"
+#include "AppManagedLocalStore.h"
+#include "AppManagedSharedStore.h"
+#include "PlatformManagedStore.h"
+
+using namespace ctx;
+
+static SchemaConf __schemaConf;
+
+static ServiceProxy* __getServiceProxy()
+{
+ static ServiceProxy proxy(CTX_CONTEXT_STORE);
+ return &proxy;
+}
+
+template<typename StoreType>
+static ContextStore* __createStore(Schema& schema, int* error)
+{
+ StoreType* store = new(std::nothrow) StoreType(__getServiceProxy());
+
+ if (!store) {
+ *error = E_NO_MEM;
+ _E("Memory allocation failed");
+ return NULL;
+ }
+
+ *error = store->init(schema);
+
+ if (*error != E_NONE) {
+ delete store;
+ return NULL;
+ }
+
+ return store;
+}
+
+ContextStoreManager::ContextStoreManager()
+{
+}
+
+ContextStoreManager::~ContextStoreManager()
+{
+}
+
+int ContextStoreManager::getStore(const std::string& uri, ContextStore** store)
+{
+ IF_FAIL_RETURN(store, E_PARAM);
+ IF_FAIL_RETURN(__schemaConf.init(), E_FAILED);
+
+ Schema& schema = __schemaConf.getSchema(uri);
+
+ int error = E_NONE;
+ ContextStore* _store = NULL;
+
+ _store = __createStore<AppManagedLocalStore>(schema, &error);
+
+ if (error == E_PARAM)
+ _store = __createStore<PlatformManagedStore>(schema, &error);
+
+ if (error == E_PARAM)
+ _store = __createStore<AppManagedSharedStore>(schema, &error);
+
+ IF_FAIL_RETURN(_store, error);
+
+ *store = _store;
+ return E_NONE;
+}
+
+int ContextStoreManager::removeStore(const std::string& uri)
+{
+ int error = AppManagedLocalStore::destroy(uri, __getServiceProxy());
+
+ if (error == E_PARAM)
+ error = PlatformManagedStore::destroy(uri, __getServiceProxy());
+
+ return error;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <ContextStoreTypesPrivate.h>
+#include <ContextStoreSearchQuery.h>
+
+using namespace ctx;
+
+ContextStoreSearchQuery::ContextStoreSearchQuery() :
+ __limit(0)
+{
+}
+
+ContextStoreSearchQuery::ContextStoreSearchQuery(const std::string& projection,
+ const std::string& selection, const std::string& sortOrder,
+ unsigned int limit) :
+ __limit(0)
+{
+}
+
+ContextStoreSearchQuery::~ContextStoreSearchQuery()
+{
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setProjection(const std::string& projection)
+{
+ __projection = projection;
+ return *this;
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setSelection(const std::string& selection)
+{
+ __selection = selection;
+ return *this;
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setSortOrder(const std::string& sortOrder)
+{
+ __sortOrder = sortOrder;
+ return *this;
+}
+
+ContextStoreSearchQuery& ContextStoreSearchQuery::setLimit(unsigned int limit)
+{
+ __limit = limit;
+ return *this;
+}
+
+bool ContextStoreSearchQuery::valid()
+{
+ // TODO
+ return true;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "PlatformManagedStore.h"
+
+using namespace ctx;
+
+PlatformManagedStore::PlatformManagedStore(ServiceProxy* proxy) :
+ __proxy(proxy)
+{
+}
+
+PlatformManagedStore::~PlatformManagedStore()
+{
+}
+
+int PlatformManagedStore::init(Schema& schema)
+{
+ // TODO
+ return E_SUPPORT;
+}
+
+int PlatformManagedStore::insert(const std::vector<std::string>& columns, Tuple& record)
+{
+ // TODO
+ return E_SUPPORT;
+}
+
+int PlatformManagedStore::insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records)
+{
+ // TODO
+ return E_SUPPORT;
+}
+
+int PlatformManagedStore::retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result)
+{
+ // TODO
+ return E_SUPPORT;
+}
+
+int PlatformManagedStore::remove(const std::string& selection)
+{
+ // TODO
+ return E_SUPPORT;
+}
+
+int PlatformManagedStore::destroy(const std::string& uri, ServiceProxy* proxy)
+{
+ // TODO
+ return E_NONE;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_PLATFORM_MANAGED_STORE_H__
+#define __CONTEXT_STORE_PLATFORM_MANAGED_STORE_H__
+
+#include <ServiceProxy.h>
+#include <ContextStore.h>
+#include <ContextStoreTypesPrivate.h>
+#include "Schema.h"
+
+namespace ctx {
+
+ class PlatformManagedStore : public ContextStore {
+ public:
+ PlatformManagedStore(ServiceProxy* proxy);
+ ~PlatformManagedStore();
+
+ int init(Schema& schema);
+
+ int insert(const std::vector<std::string>& columns, Tuple& record);
+ int insert(const std::vector<std::string>& columns, std::vector<Tuple*>& records);
+ int retrieve(const ContextStoreSearchQuery& query, std::vector<Tuple*>& result);
+ int remove(const std::string& selection);
+
+ static int destroy(const std::string& uri, ServiceProxy* proxy);
+
+ private:
+ ServiceProxy* __proxy;
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_PLATFORM_MANAGED_STORE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Schema.h"
+
+using namespace ctx;
+
+Schema::Schema()
+{
+}
+
+Schema::~Schema()
+{
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_SCHEMA_H__
+#define __CONTEXT_STORE_SCHEMA_H__
+
+#include <string>
+#include <ContextStoreTypesPrivate.h>
+
+namespace ctx {
+
+ class Schema {
+ public:
+ ~Schema();
+
+ private:
+ Schema();
+
+ friend class SchemaConf;
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_SCHEMA_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "SchemaConf.h"
+
+using namespace ctx;
+
+SchemaConf::SchemaConf()
+{
+}
+
+SchemaConf::~SchemaConf()
+{
+}
+
+bool SchemaConf::init()
+{
+ return true;
+}
+
+Schema& SchemaConf::getSchema(const std::string& uri)
+{
+ static Schema dummy;
+ return dummy;
+}
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CONTEXT_STORE_SCHEMA_CONF_H__
+#define __CONTEXT_STORE_SCHEMA_CONF_H__
+
+#include <string>
+#include <ContextStoreTypesPrivate.h>
+#include "Schema.h"
+
+namespace ctx {
+
+ class SchemaConf {
+ public:
+ SchemaConf();
+ ~SchemaConf();
+
+ bool init();
+
+ Schema& getSchema(const std::string& uri);
+ };
+
+}
+
+#endif /* __CONTEXT_STORE_SCHEMA_CONF_H__ */
#include <ContextTypes.h>
#include <ContextErrorUtil.h>
+#include <ContextStoreTypes.h>
#define CTX_CONTEXT_STORE "ContextStore"
#define CTX_CONTEXT_STORE_SPEC \