<commit_before>/*************************************************************************
 * Copyright (c) 2014 eProsima. All rights reserved.
 *
 * This copy of eProsima Fast RTPS is licensed to you under the terms described in the
 * FASTRTPS_LIBRARY_LICENSE file included in this distribution.
 *
 *************************************************************************/

/**
 * @file Locator.h	
 */

#ifndef RTPS_ELEM_LOCATOR_H_
#define RTPS_ELEM_LOCATOR_H_
#include "../../fastrtps_dll.h"
#include "Types.h"
#include <sstream>
#include <vector>
#include <cstdint>
#include <cstring>
#include <iomanip>
namespace eprosima{
namespace fastrtps{
namespace rtps{

#define LOCATOR_INVALID(loc)  {loc.kind=LOCATOR_KIND_INVALID;loc.port= LOCATOR_PORT_INVALID;LOCATOR_ADDRESS_INVALID(loc.address);}
#define LOCATOR_KIND_INVALID -1

#define LOCATOR_ADDRESS_INVALID(a) {for(uint8_t i=0;i<16;i++) a[i]=0x0;}
#define LOCATOR_PORT_INVALID 0
#define LOCATOR_KIND_RESERVED 0
#define LOCATOR_KIND_UDPv4 1
#define LOCATOR_KIND_UDPv6 2


//!@brief Class Locator_t, uniquely identifies a communication channel for a particular transport. 
//For example, an address+port combination in the case of UDP.
//!@ingroup COMMON_MODULE
class RTPS_DllAPI Locator_t{
public:

    /*!
     * @brief Specifies the locator type. Valid values are:
     * LOCATOR_KIND_UDPv4
     * LOCATOR_KIND_UDPv6
     */
	int32_t kind;
	uint32_t port;
	octet address[16];

	//!Default constructor
	Locator_t():kind(1),port(0),address{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
   {
	}

	Locator_t(Locator_t&& loc):
		kind(loc.kind),
		port(loc.port)
	{
		for(uint8_t i = 0;i<16;++i)
			address[i] = loc.address[i];
	}

	Locator_t(const Locator_t& loc) :
		kind(loc.kind),
		port(loc.port)
	{
		for(uint8_t i = 0;i<16;++i)
			address[i] = loc.address[i];
	}

	Locator_t(uint32_t portin):kind(1),port(portin)
	{
		LOCATOR_ADDRESS_INVALID(address);
	}
    
	Locator_t& operator=(const Locator_t& loc)
	{
		kind = loc.kind;
		port = loc.port;
		for(uint8_t i=0;i<16;i++)<commit_msg>Reverted locator change to solve VS2013 issue<commit_after>/*************************************************************************
 * Copyright (c) 2014 eProsima. All rights reserved.
 *
 * This copy of eProsima Fast RTPS is licensed to you under the terms described in the
 * FASTRTPS_LIBRARY_LICENSE file included in this distribution.
 *
 *************************************************************************/

/**
 * @file Locator.h	
 */

#ifndef RTPS_ELEM_LOCATOR_H_
#define RTPS_ELEM_LOCATOR_H_
#include "../../fastrtps_dll.h"
#include "Types.h"
#include <sstream>
#include <vector>
#include <cstdint>
#include <cstring>
#include <iomanip>
namespace eprosima{
namespace fastrtps{
namespace rtps{

#define LOCATOR_INVALID(loc)  {loc.kind=LOCATOR_KIND_INVALID;loc.port= LOCATOR_PORT_INVALID;LOCATOR_ADDRESS_INVALID(loc.address);}
#define LOCATOR_KIND_INVALID -1

#define LOCATOR_ADDRESS_INVALID(a) {for(uint8_t i=0;i<16;i++) a[i]=0x0;}
#define LOCATOR_PORT_INVALID 0
#define LOCATOR_KIND_RESERVED 0
#define LOCATOR_KIND_UDPv4 1
#define LOCATOR_KIND_UDPv6 2


//!@brief Class Locator_t, uniquely identifies a communication channel for a particular transport. 
//For example, an address+port combination in the case of UDP.
//!@ingroup COMMON_MODULE
class RTPS_DllAPI Locator_t{
public:

    /*!
     * @brief Specifies the locator type. Valid values are:
     * LOCATOR_KIND_UDPv4
     * LOCATOR_KIND_UDPv6
     */
	int32_t kind;
	uint32_t port;
	octet address[16];

	//!Default constructor
	Locator_t():kind(1),port(0)
   {
      LOCATOR_ADDRESS_INVALID(address);
	}

	Locator_t(Locator_t&& loc):
		kind(loc.kind),
		port(loc.port)
	{
		for(uint8_t i = 0;i<16;++i)
			address[i] = loc.address[i];
	}

	Locator_t(const Locator_t& loc) :
		kind(loc.kind),
		port(loc.port)
	{
		for(uint8_t i = 0;i<16;++i)
			address[i] = loc.address[i];
	}

	Locator_t(uint32_t portin):kind(1),port(portin)
	{
		LOCATOR_ADDRESS_INVALID(address);
	}
    
	Locator_t& operator=(const Locator_t& loc)
	{
		kind = loc.kind;
		port = loc.port;
		for(uint8_t i=0;i<16;i++)
{'fraction_non_alphanumeric': 0.18962564228040127, 'fraction_numerical': 0.025446537802789333, 'mean_word_length': 5.138138138138138, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 13, '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': '3732357', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1525, 'n_words': 324}