<commit_before>/** openrtb.h                                                      -*- C++ -*-
    <NAME>, 21 February 2013
    Copyright (c) 2013 Datacratic Inc.  All rights reserved.

    This file is part of RTBkit.

    Programmatic Description of the OpenRTB 2.0 specification.

    Documentation is taken from the OpenRTB Specification 2.0 available at
    http://www.iab.net/media/file/OpenRTB_API_Specification_Version2.0_FINAL.PDF

    That document has the following license:

    OpenRTB Specification by OpenRTB is licensed under a Creative Commons
    Attribution 3.0 License, based on a work at openrtb.info. Permissions
    beyond the scope of this license may be available at http://openrtb.info.
    To view a copy of this license, visit
    http://creativecommons.org/licenses/by/3.0/
    or write to Creative Commons, 171 Second Street, Suite 300, San Francisco,
    CA 94105, USA.
*/

#pragma once

#include <string>
#include <memory>
#include <vector>
#include "soa/types/id.h"
#include "soa/types/string.h"
#include "soa/types/url.h"
#include "jml/utils/compact_vector.h"
#include "soa/jsoncpp/value.h"
#include <iostream>

namespace OpenRTB {

using std::string;
using std::vector;
using std::unique_ptr;
using Datacratic::Id;
using Datacratic::Utf8String;
using Datacratic::Url;

typedef std::string CSList;  // comma-separated list

template<typename T>
struct Optional: public std::unique_ptr<T> {
    Optional()
    {
    }
    
    Optional(Optional && other)
        : std::unique_ptr<T>(std::move(other))
    {
    }

    Optional(const Optional & other)
    {
        if (other)
            reset(new T(*other));
    }

    Optional & operator = (const Optional & other)
    {<commit_msg>gcc 4.7: use this-> to disambiguate method<commit_after>/** openrtb.h                                                      -*- C++ -*-
    <NAME>, 21 February 2013
    Copyright (c) 2013 Datacratic Inc.  All rights reserved.

    This file is part of RTBkit.

    Programmatic Description of the OpenRTB 2.0 specification.

    Documentation is taken from the OpenRTB Specification 2.0 available at
    http://www.iab.net/media/file/OpenRTB_API_Specification_Version2.0_FINAL.PDF

    That document has the following license:

    OpenRTB Specification by OpenRTB is licensed under a Creative Commons
    Attribution 3.0 License, based on a work at openrtb.info. Permissions
    beyond the scope of this license may be available at http://openrtb.info.
    To view a copy of this license, visit
    http://creativecommons.org/licenses/by/3.0/
    or write to Creative Commons, 171 Second Street, Suite 300, San Francisco,
    CA 94105, USA.
*/

#pragma once

#include <string>
#include <memory>
#include <vector>
#include "soa/types/id.h"
#include "soa/types/string.h"
#include "soa/types/url.h"
#include "jml/utils/compact_vector.h"
#include "soa/jsoncpp/value.h"
#include <iostream>

namespace OpenRTB {

using std::string;
using std::vector;
using std::unique_ptr;
using Datacratic::Id;
using Datacratic::Utf8String;
using Datacratic::Url;

typedef std::string CSList;  // comma-separated list

template<typename T>
struct Optional: public std::unique_ptr<T> {
    Optional()
    {
    }
    
    Optional(Optional && other)
        : std::unique_ptr<T>(std::move(other))
    {
    }

    Optional(const Optional & other)
    {
        if (other)
            this->reset(new T(*other));
    }

    Optional & operator = (const Optional & other)
    {
{'fraction_non_alphanumeric': 0.10544511668107173, 'fraction_numerical': 0.01901469317199654, 'mean_word_length': 2.9365079365079363, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4394168', 'n_tokens_mistral': 1145, 'n_tokens_neox': 1066, 'n_words': 328}