#pragma once


#include "crossguid/guid.hpp"
#include <SimCore/SimCore.hpp>
#include <SimCore/UtilFunctions.hpp>
#include <iterator>
#include <utility>
#include <loguru.hpp>
#include <SimCore/Messages/Protos/Identifier.pb.h>


namespace SimCore {

    class Identifier{
        public:     

            Identifier(bool external = false) ;
            /**
            * @brief constructs the ID out of an string
            *
            */
            Identifier(xg::Guid uuid,bool external = false);

            /**
            * @brief constructs the ID out of an string
            *
            */
            Identifier(std::string str);

            /**
            * @brief constructs the ID out of an protomessage id
            *
            */
            Identifier(messages::track::Identifier id);

            /**
            * @brief returns true if the ID belongs to an external ofject 
            * @return bool
            */
            bool isExternal() const;

            /**
            * @brief return true if the number is bigger than 0
            *
            */
            bool isValid();

            /**
            * @brief returns the serilaized string of the ID
            * @brief string
            */    
            std::string serialize() const;

            std::string getUUID() const;

            /// @brief 
            /// @param lhs 
            /// @param rhs 
            /// @return 
            friend bool operator==(const Identifier &lhs,const Identifier &rhs);

        private:
            /// indicates if ID is from an external source 
            bool external_ = false;
            /// the unique uuid 
            std::string uuid_ = "";
    };
}
