Home

Kenneth Laskoski

A C++ UUID compliant to RFC 4122.

 

Project Admins:


  • Sneha Gaikwad
    Sneha Gaikwad
    2014-03-11

    Hi Kenneth,

    I am using BOOST library on UNIX Sun platform which is a 64 bit processor.
    I had used BOOST UUID but faced some issues related to compatibility of iostream and stlport4 libraries. I am using this shared object library which is relevant to DataStage.
    I am looking for another such UUID generator which works on similar lines as that of BOOST UUID also it should be utilized for 64 bit processor.
    Please let me know if OOID is a better option than that of BOOST.

     
  • Hi Sneha,

    I wouldn't say OOID is better than BOOST UUID. I have written OOID as a stripped-down version of the BOOST lib. Also I'm not fully aware of your usage scenario and I would fail to be fair expressing an opinion. That said, I think OOID cover most needs and that it wouldn't hurt if you give it a try. You can read the file cli.cpp for usage examples. If you encounter any difficulty, please let me know. -Kenneth

     
  • Sneha Gaikwad
    Sneha Gaikwad
    2014-03-12

    Hi Kenneth,

    I am looking for a functionality that would create a unique ID that of given below.

    boost::uuids::string_generator gen;
    boost::uuids::uuid u2 = gen(s);
    u = to_string(u2);


    Please recommend any function from OOID library that works on similar lines.
    I have checked cli.cpp file, please emphasize on the same.

    Also, If I would try to use the ooid library, do i have to include just ooid header files instead of libraries and en corporate in my system. -- Sneha

     
  • Hi Sneha,

    there is a convenience constructor that make a UUID from a C string, i.e. you have to call the c_str() function to use it with a std::string.

    kashmir::uuid_t u2(s.c_str());
    

    You can write a convenience to_string() function using the stringstream class:

    std:string to_string(kashmir::uuid_t uuid)
    {
        std::stringstream ss;
        ss << uuid;
        return ss.str();
    }
    

    And yes, this is a header only lib, you don't need to link with any code at all.

     
  • Sneha Gaikwad
    Sneha Gaikwad
    2014-03-12

    Hi Kenneth,

    Looks like array.h file requires some more includes! I have incorporated the ooid directory in my system, could see some compilation issues!

    Please let me know what should be included to eliminate these errors!

    (dnbGkm) $ make
    /dnb/opt/SUNWspro/prod/bin/CC -dalign -library=iostream -O -PIC -m64 -I /home/ab15609/redis-2.6.9/deps/hiredis -I /dnb/opt/IBM/InformationServer91/Server/branded_odbc/include -c ooidEx.cpp -I /home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid
    "/home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid/kashmir/array.h", line 59: Error: Too few arguments for template std::reverse_iterator.
    "/home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid/kashmir/array.h", line 70: Where: While specializing "kashmir::array".
    "/home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid/kashmir/array.h", line 70: Where: Specialized in non-template code.
    "/home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid/kashmir/array.h", line 63: Error: Too few arguments for template std::reverse_iterator.
    "/home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid/kashmir/array.h", line 70: Where: While specializing "kashmir::array".
    "/home/ab36936/DnbDSComponents_GKM/dnbGkm/ooid/kashmir/array.h", line 70: Where: Specialized in non-template code.
    2 Error(s) detected.
    *** Error code 2

     
  • Hi Sneha,

    it looks like a version conflict. You can check out the latest SVN code from sourceforge, instead of using the tar.gz file, which I think it's a bit outdated.

    svn checkout svn://svn.code.sf.net/p/ooid/code/ ooid-code
    

    Please, let me know if the issue persists. I don't have access to a unix box right now but I will review the issue later. Also, feel free to modify the code as you see fit.

     
    Last edit: Kenneth Laskoski 2014-03-12
  • Sneha Gaikwad
    Sneha Gaikwad
    2014-03-12

    Thanks Kenneth for the quick response! But I think its a conflict of stlport4 and cstd libraries. Since, the reverse iterator is expecting 1 parameter (as per cstd) and the actual code contains two parameters.
    Please let me know if you have encountered such issues!

     
  • Sneha Gaikwad
    Sneha Gaikwad
    2014-03-12

    Hi Kenneth,

    I have gone through the link already. Need to understand how can I fix this issue.
    Thank you for quick response again!