SAGA C++ API 1.6
uuid.cpp
Go to the documentation of this file.
00001 //  Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net)
00002 //  Copyright (c) 2005-2009 Hartmut Kaiser
00003 // 
00004 //  Use, modification and distribution is subject to the Boost Software
00005 //  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
00006 //  http://www.boost.org/LICENSE_1_0.txt)
00007 
00008 // include the session implementation we want to use
00009 #include <iostream>
00010 
00011 #include <saga/saga/uuid.hpp>
00012 #include <saga/impl/engine/uuid.hpp> // FIXME impl/uuid.hpp
00013 
00015 namespace saga 
00016 {
00017   uuid::uuid (void)
00018     : impl_ (new saga::impl::uuid ())
00019   {
00020   }
00021 
00022   uuid::uuid (char const * uuid_str)
00023     : impl_ (new saga::impl::uuid (uuid_str))
00024   {
00025   }
00026 
00027   std::string uuid::string (void) const
00028   {
00029     return (impl_->string ());
00030   }
00031 
00032   void uuid::create (void)
00033   {
00034     impl_->create ();
00035   }
00036 
00037   void uuid::create (char const * str)
00038   {
00039     impl_->create (str);
00040   }
00041 
00043 
00044   bool operator== (uuid const & lhs, uuid const & rhs)
00045   {
00046     return (*(lhs.impl_.get()) == *(rhs.impl_.get()));
00047   }
00048 
00049   bool operator!= (uuid const & lhs, uuid const & rhs)
00050   {
00051     return !(lhs == rhs);
00052   }
00053 
00054   bool operator<  (uuid const & lhs, uuid const & rhs)
00055   {
00056     return (*(lhs.impl_.get()) < *(rhs.impl_.get()));
00057   }
00058 
00059   bool operator>  (uuid const & lhs, uuid const & rhs)
00060   {
00061     return (*(lhs.impl_.get()) > *(rhs.impl_.get()));
00062   }
00063 
00064   bool operator<= (uuid const & lhs, uuid const & rhs)
00065   {
00066     return !(lhs > rhs);
00067   }
00068 
00069   bool operator>= (uuid const & lhs, uuid const & rhs)
00070   {
00071     return !(lhs < rhs);
00072   }
00073 
00074   std::ostream & operator<< (std::ostream & ostrm, uuid const   & rhs)
00075   {
00076     return (ostrm << rhs.string());
00077   }
00078 
00079   std::istream & operator>> (std::istream & istrm, uuid         & rhs)
00080   {
00081     std::string instr;
00082     istrm >> instr;
00083 
00084     rhs.impl_->create (instr.c_str ());
00085     return istrm;
00086   }
00088 
00089 } // namespace saga
00091 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines