diff options
author | Andrew Stitcher <astitcher@apache.org> | 2008-07-30 06:29:00 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2008-07-30 06:29:00 +0000 |
commit | ab27cb344e9d2e1ea18c1c89cda65a02a7513e4b (patch) | |
tree | 1fb429f87c356b1c205537a6b28bef9b488843fa /cpp | |
parent | 0a5cb139d56079318a1779ef217408e3fea97a12 (diff) | |
download | qpid-python-ab27cb344e9d2e1ea18c1c89cda65a02a7513e4b.tar.gz |
QPID-1198 (adapted): Change use of uuid lib not to assume const parameters
The Solaris version of uuid.h takes uint8_t* not const uint8_t*
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@680919 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/framing/Uuid.cpp | 4 | ||||
-rw-r--r-- | cpp/src/qpid/framing/Uuid.h | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/cpp/src/qpid/framing/Uuid.cpp b/cpp/src/qpid/framing/Uuid.cpp index b58d9fce96..e8d8d517dd 100644 --- a/cpp/src/qpid/framing/Uuid.cpp +++ b/cpp/src/qpid/framing/Uuid.cpp @@ -38,7 +38,7 @@ void Uuid::decode(Buffer& buf) { buf.getRawData(c_array(), size()); } -ostream& operator<<(ostream& out, const Uuid& uuid) { +ostream& operator<<(ostream& out, Uuid uuid) { char unparsed[UNPARSED_SIZE + 1]; uuid_unparse(uuid.data(), unparsed); return out << unparsed; @@ -52,7 +52,7 @@ istream& operator>>(istream& in, Uuid& uuid) { return in; } -std::string Uuid::str() const { +std::string Uuid::str() { std::ostringstream os; os << *this; return os.str(); diff --git a/cpp/src/qpid/framing/Uuid.h b/cpp/src/qpid/framing/Uuid.h index f23590ebdc..e3e309a56c 100644 --- a/cpp/src/qpid/framing/Uuid.h +++ b/cpp/src/qpid/framing/Uuid.h @@ -42,10 +42,12 @@ struct Uuid : public boost::array<uint8_t, 16> { Uuid(bool unique=false) { if (unique) generate(); else clear(); } /** Copy from 16 bytes of data. */ - Uuid(const uint8_t* data) { assign(data); } + Uuid(uint8_t* data) { assign(data); } /** Copy from 16 bytes of data. */ - void assign(const uint8_t* data) { uuid_copy(c_array(), data); } + void assign(uint8_t* data) { + uuid_copy(c_array(), data); + } /** Set to a new unique identifier. */ void generate() { uuid_generate(c_array()); } @@ -54,7 +56,9 @@ struct Uuid : public boost::array<uint8_t, 16> { void clear() { uuid_clear(c_array()); } /** Test for null (all zeros). */ - bool isNull() const { return uuid_is_null(data()); } + bool isNull() { + return uuid_is_null(data()); + } // Default op= and copy ctor are fine. // boost::array gives us ==, < etc. @@ -64,7 +68,7 @@ struct Uuid : public boost::array<uint8_t, 16> { void decode(framing::Buffer& buf); /** String value in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */ - std::string str() const; + std::string str(); template <class S> void serialize(S& s) { s.raw(begin(), size()); @@ -72,7 +76,7 @@ struct Uuid : public boost::array<uint8_t, 16> { }; /** Print in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */ -std::ostream& operator<<(std::ostream&, const Uuid&); +std::ostream& operator<<(std::ostream&, Uuid); /** Read from format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */ std::istream& operator>>(std::istream&, Uuid&); |