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 | 143899621eff8aad4e9305fd4471cea334822a96 (patch) | |
| tree | 3756e767bf44a795d8437d21677145bbc6eff8ee /qpid/cpp/src | |
| parent | 57dbdb1704d6e1c0ea937bfdf81111cb1c9cad6f (diff) | |
| download | qpid-python-143899621eff8aad4e9305fd4471cea334822a96.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@680919 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
| -rw-r--r-- | qpid/cpp/src/qpid/framing/Uuid.cpp | 4 | ||||
| -rw-r--r-- | qpid/cpp/src/qpid/framing/Uuid.h | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/qpid/cpp/src/qpid/framing/Uuid.cpp b/qpid/cpp/src/qpid/framing/Uuid.cpp index b58d9fce96..e8d8d517dd 100644 --- a/qpid/cpp/src/qpid/framing/Uuid.cpp +++ b/qpid/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/qpid/cpp/src/qpid/framing/Uuid.h b/qpid/cpp/src/qpid/framing/Uuid.h index f23590ebdc..e3e309a56c 100644 --- a/qpid/cpp/src/qpid/framing/Uuid.h +++ b/qpid/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&); |
