From: Aleksander Zdyb Date: Wed, 24 Jun 2015 12:49:21 +0000 (+0200) Subject: Add Lad::DataProvider interface X-Git-Tag: submit/tizen/20161014.065203~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=684d0ddc999e12a2c04c946924dcfe16fbf510bd;p=platform%2Fcore%2Fsecurity%2Fnice-lad.git Add Lad::DataProvider interface 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 --- diff --git a/src/Lad/DataProvider.h b/src/Lad/DataProvider.h new file mode 100644 index 0000000..01700b6 --- /dev/null +++ b/src/Lad/DataProvider.h @@ -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 + * @version 1.0 + */ + +#ifndef SRC_LAD_DATAPROVIDER_H +#define SRC_LAD_DATAPROVIDER_H + +#include +#include + +namespace Lad { + +class DataProvider { +public: + typedef std::list 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 index 0000000..a4bba65 --- /dev/null +++ b/src/Lad/DummyDataProvider.cpp @@ -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 + * @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 index 0000000..250432e --- /dev/null +++ b/src/Lad/DummyDataProvider.h @@ -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 + * @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 */