<commit_before>#include "watcherSerialize.h"
#include "labelMessage.h"
#include "messageTypesAndVersions.h"

using namespace std;

namespace watcher {
    namespace event {
        INIT_LOGGER(LabelMessage, "Message.LabelMessage");

        LabelMessage::LabelMessage(const string &label_, int fontSize_)   :
            Message(LABEL_MESSAGE_TYPE, LABEL_MESSAGE_VERSION),
            label(label_),
            fontSize(fontSize_),
            foreground(Color::black),
            background(Color::white),
            expiration(0),
            addLabel(true),
            layer(),
            lat(0),
            lng(0),
            alt(0)
        {
            TRACE_ENTER();
            TRACE_EXIT();
        }

        LabelMessage::LabelMessage(const string &label_, const boost::asio::ip::address &address_, int fontSize_)   :
            Message(LABEL_MESSAGE_TYPE, LABEL_MESSAGE_VERSION),
            label(label_),
            fontSize(fontSize_),
            foreground(Color::black),
            background(Color::white),
            expiration(0),
            addLabel(true),
            layer(),
            lat(0),
            lng(0),
            alt(0)
        {
            TRACE_ENTER();
            fromNodeID=address_; 
            TRACE_EXIT();
        }

        LabelMessage::LabelMessage(const std::string &label_, const float &lat_, const float &lng_, const float &alt_, const int fontSize_) : 
            Message(LABEL_MESSAGE_TYPE, LABEL_MESSAGE_VERSION),
            label(label_),
            fontSize(fontSize_),
            foreground(Color::black),
            background(Color::white),
            expiration(0),
            addLabel(true),
            layer(),
            lat(lat_),
            lng(lng_),
            alt(alt_)
        {
            TRACE_ENTER();
            TRACE_EXIT();
        }

        LabelMessage::LabelMessage(const LabelMessage &other) : 
            Message(other),
            label(other.label),
            fontSize(other.fontSize),
            foreground(other.foreground),
            background(other.background),
            expiration(other.expiration),
            addLabel(other.addLabel),
            layer(other.layer),
            lat(other.lat),
            lng(other.lng),
            alt(other.alt)
        {
            TRACE_ENTER();
            TRACE_EXIT();
        }

        bool LabelMessage::operator==(const LabelMessage &other) const
        {
            TRACE_ENTER();
 
            bool retVal = 
                    Message::operator==(other) && 
                    lat==other.lat && 
                    lng==other.lng &&
                    alt==other.alt;
                    label==other.label;

            // These are not distinguishing features
            //  foreground==other.foreground,
            //  background==other.background,
            //  expiration==other.expiration,
            //  fontSize==other.FontSize;

            TRACE_EXIT_RET(retVal);
            return retVal;
        }

        LabelMessage &LabelMessage::operator=(const LabelMessage &other)
        {
            TRACE_ENTER();

            Message::operator=(other);
            label=other.label; 
            fontSize=other.fontSize;
            foreground=other.foreground;
            background=other.background;
            expiration=other.expiration;
            addLabel=other.addLabel;
            layer=other.layer;<commit_msg>labelMessage: use layer when determining oper==()<commit_after>#include "watcherSerialize.h"
#include "labelMessage.h"
#include "messageTypesAndVersions.h"

using namespace std;

namespace watcher {
    namespace event {
        INIT_LOGGER(LabelMessage, "Message.LabelMessage");

        LabelMessage::LabelMessage(const string &label_, int fontSize_)   :
            Message(LABEL_MESSAGE_TYPE, LABEL_MESSAGE_VERSION),
            label(label_),
            fontSize(fontSize_),
            foreground(Color::black),
            background(Color::white),
            expiration(0),
            addLabel(true),
            layer(),
            lat(0),
            lng(0),
            alt(0)
        {
            TRACE_ENTER();
            TRACE_EXIT();
        }

        LabelMessage::LabelMessage(const string &label_, const boost::asio::ip::address &address_, int fontSize_)   :
            Message(LABEL_MESSAGE_TYPE, LABEL_MESSAGE_VERSION),
            label(label_),
            fontSize(fontSize_),
            foreground(Color::black),
            background(Color::white),
            expiration(0),
            addLabel(true),
            layer(),
            lat(0),
            lng(0),
            alt(0)
        {
            TRACE_ENTER();
            fromNodeID=address_; 
            TRACE_EXIT();
        }

        LabelMessage::LabelMessage(const std::string &label_, const float &lat_, const float &lng_, const float &alt_, const int fontSize_) : 
            Message(LABEL_MESSAGE_TYPE, LABEL_MESSAGE_VERSION),
            label(label_),
            fontSize(fontSize_),
            foreground(Color::black),
            background(Color::white),
            expiration(0),
            addLabel(true),
            layer(),
            lat(lat_),
            lng(lng_),
            alt(alt_)
        {
            TRACE_ENTER();
            TRACE_EXIT();
        }

        LabelMessage::LabelMessage(const LabelMessage &other) : 
            Message(other),
            label(other.label),
            fontSize(other.fontSize),
            foreground(other.foreground),
            background(other.background),
            expiration(other.expiration),
            addLabel(other.addLabel),
            layer(other.layer),
            lat(other.lat),
            lng(other.lng),
            alt(other.alt)
        {
            TRACE_ENTER();
            TRACE_EXIT();
        }

        bool LabelMessage::operator==(const LabelMessage &other) const
        {
            TRACE_ENTER();
 
            bool retVal = 
                    Message::operator==(other) && 
                    lat==other.lat && 
                    lng==other.lng &&
                    alt==other.alt &&
                    label==other.label &&
                    layer==other.layer;

            // These are not distinguishing features
            //  foreground==other.foreground,
            //  background==other.background,
            //  expiration==other.expiration,
            //  fontSize==other.FontSize;

            TRACE_EXIT_RET(retVal);
            return retVal;
        }

        LabelMessage &LabelMessage::operator=(const LabelMessage &other)
        {
            TRACE_ENTER();

            Message::operator=(other);
            label=other.label; 
            fontSize=other.fontSize;
            foreground=other.foreground;
            background=other.background;
            expiration=other.expiration;
            addLabel=other.addLabel;
            layer=other.layer;
{'fraction_non_alphanumeric': 0.10599942313239112, 'fraction_numerical': 0.0025959042399769255, 'mean_word_length': 1.5742390497401633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5606378', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1752, 'n_words': 285}