<commit_before>/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2016 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%
 */
#include "joynr/SubscriptionQos.h"
#include <limits>
#include <chrono>

namespace joynr
{

const std::int64_t& SubscriptionQos::DEFAULT_PUBLICATION_TTL_MS()
{
    static const std::int64_t defaultPublicationTtl = 10000;
    return defaultPublicationTtl;
}

const std::int64_t& SubscriptionQos::DEFAULT_PUBLICATION_TTL()
{
    return DEFAULT_PUBLICATION_TTL_MS();
}

const std::int64_t& SubscriptionQos::MIN_PUBLICATION_TTL_MS()
{
    static const std::int64_t minPublicationTtl = 100;
    return minPublicationTtl;
}

const std::int64_t& SubscriptionQos::MIN_PUBLICATION_TTL()
{
    return MIN_PUBLICATION_TTL_MS();
}

const std::int64_t& SubscriptionQos::MAX_PUBLICATION_TTL_MS()
{
    static const std::int64_t maxPublicationTtl = 2592000000UL;
    return maxPublicationTtl;
}

const std::int64_t& SubscriptionQos::MAX_PUBLICATION_TTL()
{
    return MAX_PUBLICATION_TTL_MS();
}

const std::int64_t& SubscriptionQos::NO_EXPIRY_DATE()
{
    static std::int64_t noExpiryDate = 0;
    return noExpiryDate;
}

SubscriptionQos::SubscriptionQos()
        : expiryDateMs(NO_EXPIRY_DATE()), publicationTtlMs(DEFAULT_PUBLICATION_TTL_MS())
{
    setValidityMs(1000);
}

SubscriptionQos::SubscriptionQos(const std::int64_t& validityMs)
        : expiryDateMs(NO_EXPIRY_DATE()), publicationTtlMs(DEFAULT_PUBLICATION_TTL_MS())
{
    setValidityMs(validityMs);
}

std::int64_t SubscriptionQos::getPublicationTtlMs() const
{
    return publicationTtlMs;
}

std::int64_t SubscriptionQos::getPublicationTtl() const
{
    return getPublicationTtlMs();
}<commit_msg>[C++] Do not call setValidity in default constructor of SubscriptionQoS.<commit_after>/*
 * #%L
 * %%
 * Copyright (C) 2011 - 2016 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%
 */
#include "joynr/SubscriptionQos.h"
#include <limits>
#include <chrono>

namespace joynr
{

const std::int64_t& SubscriptionQos::DEFAULT_PUBLICATION_TTL_MS()
{
    static const std::int64_t defaultPublicationTtl = 10000;
    return defaultPublicationTtl;
}

const std::int64_t& SubscriptionQos::DEFAULT_PUBLICATION_TTL()
{
    return DEFAULT_PUBLICATION_TTL_MS();
}

const std::int64_t& SubscriptionQos::MIN_PUBLICATION_TTL_MS()
{
    static const std::int64_t minPublicationTtl = 100;
    return minPublicationTtl;
}

const std::int64_t& SubscriptionQos::MIN_PUBLICATION_TTL()
{
    return MIN_PUBLICATION_TTL_MS();
}

const std::int64_t& SubscriptionQos::MAX_PUBLICATION_TTL_MS()
{
    static const std::int64_t maxPublicationTtl = 2592000000UL;
    return maxPublicationTtl;
}

const std::int64_t& SubscriptionQos::MAX_PUBLICATION_TTL()
{
    return MAX_PUBLICATION_TTL_MS();
}

const std::int64_t& SubscriptionQos::NO_EXPIRY_DATE()
{
    static std::int64_t noExpiryDate = 0;
    return noExpiryDate;
}

SubscriptionQos::SubscriptionQos()
        : expiryDateMs(NO_EXPIRY_DATE()), publicationTtlMs(DEFAULT_PUBLICATION_TTL_MS())
{
}

SubscriptionQos::SubscriptionQos(const std::int64_t& validityMs)
        : expiryDateMs(NO_EXPIRY_DATE()), publicationTtlMs(DEFAULT_PUBLICATION_TTL_MS())
{
    setValidityMs(validityMs);
}

std::int64_t SubscriptionQos::getPublicationTtlMs() const
{
    return publicationTtlMs;
}

std::int64_t SubscriptionQos::getPublicationTtl() const
{
    return getPublicationTtlMs();
}
{'fraction_non_alphanumeric': 0.10108303249097472, 'fraction_numerical': 0.027527075812274367, 'mean_word_length': 5.314814814814815, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1530280', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1483, 'n_words': 350}