<commit_before>/*
 * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
 */

#ifndef SRC_BGP_MESSAGE_BUILDER_H_
#define SRC_BGP_MESSAGE_BUILDER_H_

#include <string>

#include "bgp/bgp_rib_policy.h"

class BgpMessageBuilder;
class BgpRoute;
class BgpTable;
class BgpXmppMessageBuilder;
class IPeerUpdate;
class RibOutAttr;
class RibOut;

class Message {
public:
    Message() : num_reach_route_(0), num_unreach_route_(0) { }
    virtual ~Message() { }
    virtual bool Start(const RibOut *ribout, bool cache_routes,
        const RibOutAttr *roattr, const BgpRoute *route) = 0;
    virtual bool AddRoute(const BgpRoute *route, const RibOutAttr *roattr) = 0;
    virtual void Finish() = 0;
    virtual const uint8_t *GetData(IPeerUpdate *peer_update, size_t *lenp,
        const std::string **msg_str) = 0;
    uint32_t num_reach_routes() const { return num_reach_route_; }
    uint32_t num_unreach_routes() const { return num_unreach_route_; }

protected:
    uint32_t num_reach_route_;
    uint32_t num_unreach_route_;

    virtual void Reset() {
        num_reach_route_ =  0;
        num_unreach_route_ = 0;
    }
<commit_msg>Change update reach and unreach counters to uint64_t<commit_after>/*
 * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
 */

#ifndef SRC_BGP_MESSAGE_BUILDER_H_
#define SRC_BGP_MESSAGE_BUILDER_H_

#include <string>

#include "bgp/bgp_rib_policy.h"

class BgpMessageBuilder;
class BgpRoute;
class BgpTable;
class BgpXmppMessageBuilder;
class IPeerUpdate;
class RibOutAttr;
class RibOut;

class Message {
public:
    Message() : num_reach_route_(0), num_unreach_route_(0) { }
    virtual ~Message() { }
    virtual bool Start(const RibOut *ribout, bool cache_routes,
        const RibOutAttr *roattr, const BgpRoute *route) = 0;
    virtual bool AddRoute(const BgpRoute *route, const RibOutAttr *roattr) = 0;
    virtual void Finish() = 0;
    virtual const uint8_t *GetData(IPeerUpdate *peer_update, size_t *lenp,
        const std::string **msg_str) = 0;
    uint64_t num_reach_routes() const { return num_reach_route_; }
    uint64_t num_unreach_routes() const { return num_unreach_route_; }

protected:
    uint64_t num_reach_route_;
    uint64_t num_unreach_route_;

    virtual void Reset() {
        num_reach_route_ =  0;
        num_unreach_route_ = 0;
    }

{'fraction_non_alphanumeric': 0.08789314950452391, 'fraction_numerical': 0.018957345971563982, 'mean_word_length': 4.277272727272727, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7359435', 'n_tokens_mistral': 850, 'n_tokens_neox': 813, 'n_words': 207}