Reorganize file structure to distinguish server/client headers 16/123116/2
authorMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 4 Apr 2017 12:17:39 +0000 (21:17 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Tue, 4 Apr 2017 12:19:36 +0000 (21:19 +0900)
Change-Id: Ief37542ab78d9f747bc2f5c20ebbe9924389dc57
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
15 files changed:
CMakeLists.txt
include/JobScheduler.h [deleted file]
include/JobSchedulerService.h [deleted file]
include/JobSchedulerTypes.h [deleted file]
include/job_scheduler_internal.h [new file with mode: 0644]
include/job_scheduler_types_internal.h [new file with mode: 0644]
include/private/JobSchedulerService.h [new file with mode: 0644]
src/client-dummy/CMakeLists.txt
src/client-dummy/JobScheduler.cpp [deleted file]
src/client-dummy/job_scheduler.cpp [new file with mode: 0644]
src/client/CMakeLists.txt
src/client/JobScheduler.cpp [deleted file]
src/client/job_scheduler.cpp [new file with mode: 0644]
src/server-dummy/CMakeLists.txt
src/server/CMakeLists.txt

index 7da778c2752a0c8207437d311bd2c3c8301c8483..9028ac3baadf364afd779780cc935c46b6b149c2 100644 (file)
@@ -7,7 +7,6 @@ SET(INCDIR "${CMAKE_INSTALL_INCLUDEDIR}/context-service")
 
 INCLUDE_DIRECTORIES(
        ${CMAKE_INSTALL_PREFIX}/${INCDIR}/private
-       ${CMAKE_SOURCE_DIR}/include
        ${CMAKE_SOURCE_DIR}/src/shared
 )
 
@@ -20,16 +19,9 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(PC_INCLUDE "${CMAKE_INSTALL_PREFIX}/${INCDIR}")
 SET(PC_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
 
-INSTALL(
-       FILES ${CMAKE_SOURCE_DIR}/include/JobSchedulerService.h
-       DESTINATION ${INCDIR}/private
-)
 INSTALL(
        DIRECTORY ${CMAKE_SOURCE_DIR}/include/
        DESTINATION ${INCDIR}
-       FILES_MATCHING
-       PATTERN "*.h"
-       PATTERN "JobSchedulerService.h" EXCLUDE
 )
 
 ADD_SUBDIRECTORY(src/client-dummy)
diff --git a/include/JobScheduler.h b/include/JobScheduler.h
deleted file mode 100644 (file)
index 9255298..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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_JOB_SCHEDULER_H__
-#define __CONTEXT_JOB_SCHEDULER_H__
-
-#include <JobSchedulerTypes.h>
-
-/* Internal C/C++ API */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-int ctx_job_scheduler_test();
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/include/JobSchedulerService.h b/include/JobSchedulerService.h
deleted file mode 100644 (file)
index 37cd6bd..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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_JOB_SCHEDULER_SERVICE_H__
-#define __CONTEXT_JOB_SCHEDULER_SERVICE_H__
-
-/* This header SHOULD NOT be included by other headers in this directory. */
-
-#include <ServiceBase.h>
-#include <JobSchedulerTypes.h>
-
-namespace ctx {
-
-       class EXPORT_API JobSchedulerService : public ServiceBase {
-       public:
-               JobSchedulerService(GDBusConnection* conn);
-               ~JobSchedulerService();
-
-               bool isUserService();
-
-       protected:
-               bool prepare();
-               void cleanup();
-
-               ClientBase* createClient(const std::string& busName);
-       };
-
-}
-
-#endif
diff --git a/include/JobSchedulerTypes.h b/include/JobSchedulerTypes.h
deleted file mode 100644 (file)
index f80bb81..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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_JOB_SCHEDULER_TYPES_H__
-#define __CONTEXT_JOB_SCHEDULER_TYPES_H__
-
-#include <tizen.h>
-
-
-#endif
diff --git a/include/job_scheduler_internal.h b/include/job_scheduler_internal.h
new file mode 100644 (file)
index 0000000..ed0dda1
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * 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 __CAPI_CONTEXT_JOB_SCHEDULER_INTERNAL_H__
+#define __CAPI_CONTEXT_JOB_SCHEDULER_INTERNAL_H__
+
+#include <tizen.h>
+#include <job_scheduler_types_internal.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+int ctx_job_scheduler_test();
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/job_scheduler_types_internal.h b/include/job_scheduler_types_internal.h
new file mode 100644 (file)
index 0000000..5bcbb83
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * 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 __CAPI_CONTEXT_JOB_SCHEDULER_TYPES_INTERNAL_H__
+#define __CAPI_CONTEXT_JOB_SCHEDULER_TYPES_INTERNAL_H__
+
+
+#endif
diff --git a/include/private/JobSchedulerService.h b/include/private/JobSchedulerService.h
new file mode 100644 (file)
index 0000000..9735ab2
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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_JOB_SCHEDULER_SERVICE_H__
+#define __CONTEXT_JOB_SCHEDULER_SERVICE_H__
+
+#include <ServiceBase.h>
+
+namespace ctx {
+
+       class EXPORT_API JobSchedulerService : public ServiceBase {
+       public:
+               JobSchedulerService(GDBusConnection* conn);
+               ~JobSchedulerService();
+
+               bool isUserService();
+
+       protected:
+               bool prepare();
+               void cleanup();
+
+               ClientBase* createClient(const std::string& busName);
+       };
+
+}
+
+#endif
index d9d366d3839053b6b9b14ddc1776eddcd29a26d7..eb5a5eb743670d45dead6d2325c19896fbf42af9 100644 (file)
@@ -2,6 +2,8 @@ SET(target "${PROJECT_NAME}-client")
 
 SET(DEPS "${DEPS} context-common-client")
 
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
 FILE(GLOB_RECURSE SRCS *.cpp)
 MESSAGE("Sources: ${SRCS}")
 
diff --git a/src/client-dummy/JobScheduler.cpp b/src/client-dummy/JobScheduler.cpp
deleted file mode 100644 (file)
index a4d4e1d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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 <JobSchedulerTypesPrivate.h>
-#include <JobScheduler.h>
-
-using namespace ctx;
-
-/* TODO: Remove this test code */
-EXPORT_API int ctx_job_scheduler_test()
-{
-       return E_SUPPORT;
-}
diff --git a/src/client-dummy/job_scheduler.cpp b/src/client-dummy/job_scheduler.cpp
new file mode 100644 (file)
index 0000000..8acd560
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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 <JobSchedulerTypesPrivate.h>
+#include <job_scheduler_internal.h>
+
+/* TODO: Remove this test code */
+EXPORT_API int ctx_job_scheduler_test()
+{
+       return E_SUPPORT;
+}
index 8f551d7c578adeb9196715d2b8afc510806cdb43..cce6a583e4f1cb2409aa4ae72bcbe66037db990f 100644 (file)
@@ -2,6 +2,8 @@ SET(target "${PROJECT_NAME}-client-genuine")
 
 SET(DEPS "${DEPS} context-common-client")
 
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+
 FILE(GLOB_RECURSE SRCS *.cpp ../shared/*.cpp)
 MESSAGE("Sources: ${SRCS}")
 
diff --git a/src/client/JobScheduler.cpp b/src/client/JobScheduler.cpp
deleted file mode 100644 (file)
index c38188c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 <JobSchedulerTypesPrivate.h>
-#include <ServiceProxy.h>
-#include <JobScheduler.h>
-
-using namespace ctx;
-
-/* TODO: Remove this test code */
-EXPORT_API int ctx_job_scheduler_test()
-{
-       // ServiceProxy object can be maintained as a static object.
-       ServiceProxy proxy(CTX_JOB_SCHEDULER);
-
-       GVariant* output = NULL;
-
-       int err = proxy.call("test", g_variant_new("(i)", 100), &output);
-
-       _I(YELLOW("Return: %d (%s)"), err, CTX_ERROR_STR(err));
-
-       return err;
-}
diff --git a/src/client/job_scheduler.cpp b/src/client/job_scheduler.cpp
new file mode 100644 (file)
index 0000000..8acd560
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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 <JobSchedulerTypesPrivate.h>
+#include <job_scheduler_internal.h>
+
+/* TODO: Remove this test code */
+EXPORT_API int ctx_job_scheduler_test()
+{
+       return E_SUPPORT;
+}
index 89130039dd67551531a0d454a07816c2da17c165..3934aa85f7b7b58ca2c1fb670143642f9704ea6e 100644 (file)
@@ -2,6 +2,8 @@ SET(target "${PROJECT_NAME}-server")
 
 SET(DEPS "${DEPS} context-common-server")
 
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/private)
+
 FILE(GLOB_RECURSE SRCS *.cpp)
 MESSAGE("Sources: ${SRCS}")
 
index 64a741fc465d26ff7a3c08bae0354e2b1b60e1a7..782313c486557798c979406bb7a4d66a54d5b80a 100644 (file)
@@ -2,6 +2,9 @@ SET(target "${PROJECT_NAME}-server-genuine")
 
 SET(DEPS "${DEPS} context-common-server")
 
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/private)
+
 FILE(GLOB_RECURSE SRCS *.cpp ../shared/*.cpp)
 MESSAGE("Sources: ${SRCS}")