<commit_before>/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2017 BMW Car IT GmbH
 * %%
 * 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.
 * #L%
 */

#ifndef MESSAGINGQOS_H
#define MESSAGINGQOS_H

#include <cstdint>
#include <string>
#include <unordered_map>
#include <iosfwd>
#include "joynr/JoynrCommonExport.h"
#include "joynr/MessagingQosEffort.h"

namespace joynr
{

/**
  * @brief Class for messaging quality of service settings
  */
class JOYNRCOMMON_EXPORT MessagingQos
{
public:
    /**
     * @brief Base constructor
     * @param ttl The time to live in milliseconds
     * @param effort The effort to expend during message delivery
     * @param encrypt Specifies, whether messages will be sent encrypted
     */
    explicit MessagingQos(std::uint64_t ttl = default_ttl,
                          MessagingQosEffort::Enum effort = MessagingQosEffort::Enum::NORMAL,
                          bool encrypt = false);

    /**
     * @brief Base constructor
     * @param effort The effort to expend during message delivery
     * @param encrypt Specifies, whether messages will be sent encrypted
     */
    explicit MessagingQos(MessagingQosEffort::Enum effort, bool encrypt = false);

    /**
     * @brief Base constructor
     * @param ttl The time to live in milliseconds
     * @param encrypt Specifies, whether messages will be sent encrypted
     */
    explicit MessagingQos(std::uint64_t ttl, bool encrypt);

    /*
     * Adding a constructor with just 'encrypt' is not possible since it results
     * ambiguous constructors.
     */

    /** @brief Copy constructor */
    MessagingQos(const MessagingQos& other) = default;

    /** @brief Destructor */
    virtual ~MessagingQos() = default;

    /**
     * @brief Stringifies the class
     * @return stringified class content
     */
    virtual std::string toString() const;

    /**
     * @brief Gets the current time to live settings
     * @return time to live in milliseconds
     */
    std::uint64_t getTtl() const;

    /**
     * @brief Sets the time to live
     * @param ttl Time to live in milliseconds
     */
    void setTtl(const std::uint64_t& ttl);

    /**
     * @brief get the effort to expend during message delivery
     */<commit_msg>[C++] Remove not needed comment in public header file.<commit_after>/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2017 BMW Car IT GmbH
 * %%
 * 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.
 * #L%
 */

#ifndef MESSAGINGQOS_H
#define MESSAGINGQOS_H

#include <cstdint>
#include <string>
#include <unordered_map>
#include <iosfwd>
#include "joynr/JoynrCommonExport.h"
#include "joynr/MessagingQosEffort.h"

namespace joynr
{

/**
  * @brief Class for messaging quality of service settings
  */
class JOYNRCOMMON_EXPORT MessagingQos
{
public:
    /**
     * @brief Base constructor
     * @param ttl The time to live in milliseconds
     * @param effort The effort to expend during message delivery
     * @param encrypt Specifies, whether messages will be sent encrypted
     */
    explicit MessagingQos(std::uint64_t ttl = default_ttl,
                          MessagingQosEffort::Enum effort = MessagingQosEffort::Enum::NORMAL,
                          bool encrypt = false);

    /**
     * @brief Base constructor
     * @param effort The effort to expend during message delivery
     * @param encrypt Specifies, whether messages will be sent encrypted
     */
    explicit MessagingQos(MessagingQosEffort::Enum effort, bool encrypt = false);

    /**
     * @brief Base constructor
     * @param ttl The time to live in milliseconds
     * @param encrypt Specifies, whether messages will be sent encrypted
     */
    explicit MessagingQos(std::uint64_t ttl, bool encrypt);

    /** @brief Copy constructor */
    MessagingQos(const MessagingQos& other) = default;

    /** @brief Destructor */
    virtual ~MessagingQos() = default;

    /**
     * @brief Stringifies the class
     * @return stringified class content
     */
    virtual std::string toString() const;

    /**
     * @brief Gets the current time to live settings
     * @return time to live in milliseconds
     */
    std::uint64_t getTtl() const;

    /**
     * @brief Sets the time to live
     * @param ttl Time to live in milliseconds
     */
    void setTtl(const std::uint64_t& ttl);

    /**
     * @brief get the effort to expend during message delivery
     */
{'fraction_non_alphanumeric': 0.0883936861652739, 'fraction_numerical': 0.007428040854224698, 'mean_word_length': 2.9227967953386744, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5381417', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1494, 'n_words': 576}