Add Lad::DataProvider interface 38/43738/1
authorAleksander Zdyb <a.zdyb@samsung.com>
Wed, 24 Jun 2015 12:49:21 +0000 (14:49 +0200)
committerAleksander Zdyb <a.zdyb@samsung.com>
Fri, 10 Jul 2015 12:50:28 +0000 (14:50 +0200)
This interface will be used by plugable components to provide
resource groups and possibly other data.

Also implemented DummyDataProvider returning no groups.

Change-Id: I806334c429d7f239c57d0b9aeb3e2f203670afc8

src/Lad/DataProvider.h [new file with mode: 0644]
src/Lad/DummyDataProvider.cpp [new file with mode: 0644]
src/Lad/DummyDataProvider.h [new file with mode: 0644]

diff --git a/src/Lad/DataProvider.h b/src/Lad/DataProvider.h
new file mode 100644 (file)
index 0000000..01700b6
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+/**
+ * @file        src/Lad/DataProvider.h
+ * @author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version     1.0
+ */
+
+#ifndef SRC_LAD_DATAPROVIDER_H
+#define SRC_LAD_DATAPROVIDER_H
+
+#include <list>
+#include <string>
+
+namespace Lad {
+
+class DataProvider {
+public:
+    typedef std::list<std::string> GroupsList;
+
+    virtual ~DataProvider() = default;
+
+    virtual GroupsList getResourceGroups(void) = 0;
+};
+
+} /* namespace Lad */
+
+#endif /* SRC_LAD_DATAPROVIDER_H */
diff --git a/src/Lad/DummyDataProvider.cpp b/src/Lad/DummyDataProvider.cpp
new file mode 100644 (file)
index 0000000..a4bba65
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+/**
+ * @file        src/Lad/DummyDataProvider.cpp
+ * @author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version     1.0
+ */
+
+#include "DummyDataProvider.h"
+
+namespace Lad {
+
+DataProvider::GroupsList DummyDataProvider::getResourceGroups(void) {
+    return DataProvider::GroupsList();
+}
+
+} /* namespace Lad */
diff --git a/src/Lad/DummyDataProvider.h b/src/Lad/DummyDataProvider.h
new file mode 100644 (file)
index 0000000..250432e
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ *    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.
+ */
+/**
+ * @file        src/Lad/DummyDataProvider.h
+ * @author      Aleksander Zdyb <a.zdyb@samsung.com>
+ * @version     1.0
+ */
+
+#ifndef SRC_LAD_DUMMYDATAPROVIDER_H
+#define SRC_LAD_DUMMYDATAPROVIDER_H
+
+#include "DataProvider.h"
+
+namespace Lad {
+
+class DummyDataProvider : public DataProvider {
+public:
+    virtual ~DummyDataProvider() = default;
+
+    virtual DataProvider::GroupsList getResourceGroups(void);
+};
+
+} /* namespace Lad */
+
+#endif /* SRC_LAD_DUMMYDATAPROVIDER_H */