+++ /dev/null
-/*
- * Copyright (c) 2017 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 PrivaciesSequence.cpp
- * @author Zofia Grzelewska <z.abramowska@samsung.com>
- * @brief The implementation of PrivaciesSequence
- */
-
-#include "PrivaciesSequence.h"
-
-namespace AskUser {
-
-namespace Notification {
-
-PrivaciesSequence::PrivaciesSequence() : m_currentPrivacy(m_privacies.begin()), m_nextPrivacy(m_privacies.begin())
-{}
-
-void PrivaciesSequence::rewind() {
- m_currentPrivacy = m_privacies.begin();
- m_nextPrivacy = m_privacies.begin();
-}
-
-void PrivaciesSequence::setPrivacies(const std::vector<Privacy> &privacies) {
- m_privacies = privacies;
- m_currentPrivacy = m_privacies.begin();
- m_nextPrivacy = m_privacies.begin();
-}
-
-bool PrivaciesSequence::getCurrentPrivacy(Privacy &privacy) {
- if (m_currentPrivacy == m_privacies.end())
- return false;
- privacy = *m_currentPrivacy;
- return true;
-}
-
-bool PrivaciesSequence::getNextPrivacy(Privacy &privacy) {
- m_currentPrivacy = m_nextPrivacy;
- if (m_currentPrivacy == m_privacies.end())
- return false;
- privacy = *m_currentPrivacy;
- m_nextPrivacy++;
- return true;
-}
-
-size_t PrivaciesSequence::size() {
- return m_privacies.size();
-}
-
-} // namespace Notification
-
-} // namespace AskUser
+++ /dev/null
-/*
- * Copyright (c) 2017 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 PrivaciesSequence.h
- * @author Zofia Grzelewska <z.abramowska@samsung.com>
- * @brief The definition of PrivaciesSequence
- */
-#pragma once
-
-#include <string>
-#include <vector>
-
-#include <types/PolicyTypes.h>
-
-namespace AskUser {
-
-namespace Notification {
-
-/*
- * Container allowing sequential access to privacy vector
- */
-class PrivaciesSequence {
-public:
- PrivaciesSequence();
- void setPrivacies(const std::vector<Privacy> &privacies);
- /*
- * Get next privacy in sequence. Returns false, when there is no more privacies.
- */
- bool getNextPrivacy(Privacy &privacy);
-
- /*
- * Get current privacy in sequence.
- */
- bool getCurrentPrivacy(Privacy &privacy);
-
- /*
- * Rewind to the beginning of privacy sequence.
- */
- void rewind();
-
- /*
- * Returns Privacies count
- */
- size_t size();
-
- virtual ~PrivaciesSequence() {}
-private:
- typedef std::vector<Privacy> PrivacyVector;
- PrivacyVector m_privacies;
- PrivacyVector::iterator m_currentPrivacy;
- PrivacyVector::iterator m_nextPrivacy;
-};
-
-}
-
-}