Changeset 12773 for source/ariba/utility/transport/messages
- Timestamp:
- Mar 26, 2014, 6:28:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/transport/messages/message.hpp
r12060 r12773 11 11 #include<boost/shared_ptr.hpp> 12 12 #include<cstring> 13 #include <cassert> 13 14 14 15 #include "shared_buffer.hpp" … … 68 69 /// Create a new message 69 70 inline message_t() : 70 imsg() { 71 imsg(), 72 MAGIC_IDENTIFIER("!!message_t-MAGIC_IDENTIFIER!!"), // XXX Mario: Debugging 73 MAGIC_NUMBER(421337) // XXX Mario: Debugging 74 { 71 75 } 72 76 73 77 /// Copy message 74 78 inline message_t(const message_t& msg) : 75 imsg(msg.imsg) 79 imsg(msg.imsg), 80 MAGIC_IDENTIFIER(msg.MAGIC_IDENTIFIER), // XXX 81 MAGIC_NUMBER(msg.MAGIC_NUMBER) // XXX 82 76 83 { 84 assert ( msg.MAGIC_NUMBER == 421337 ); // XXX 85 77 86 if ( imsg ) 78 87 imsg->owner = NULL; … … 85 94 86 95 /// Assign another message 87 inline message_t& operator=(const message_t& msg) { 88 msg.imsg->owner = NULL; 89 imsg = msg.imsg; 96 inline message_t& operator=(const message_t& msg) 97 { 98 assert ( msg.MAGIC_NUMBER == 421337 ); // XXX 99 100 if ( msg.imsg ) 101 { 102 msg.imsg->owner = NULL; 103 imsg = msg.imsg; 104 } 105 else 106 { 107 // TODO: is this a valid state? (since it can definitely been reached...) 108 imsg.reset(); 109 } 110 90 111 return *this; 91 112 } … … 252 273 shared_buffer_t buffers[message_max_buffers]; 253 274 mlength_t index, length; 275 276 // XXX Mario: Debugging 277 const std::string MAGIC_IDENTIFIER; 278 const int MAGIC_NUMBER; 254 279 public: 255 280 inline imsg_t() : 256 index(0), length(0) { 281 owner(NULL), 282 index(0), 283 length(0), 284 MAGIC_IDENTIFIER("!!imsg_t-MAGIC_IDENTIFIER!!"), // XXX Mario: Debugging 285 MAGIC_NUMBER(133742) 286 { 257 287 } 258 288 inline imsg_t(const imsg_t& imsg) : 259 index(imsg.index), length(imsg.length) { 289 index(imsg.index), length(imsg.length), 290 MAGIC_IDENTIFIER(imsg.MAGIC_IDENTIFIER), // XXX 291 MAGIC_NUMBER(imsg.MAGIC_NUMBER) // XXX 292 { 260 293 for (mlength_t i = 0; i < length; i++) 261 294 at(index + i) = imsg.at(index + i); … … 336 369 } 337 370 boost::shared_ptr<imsg_t> imsg; 371 372 // XXX Mario: Debugging 373 public: 374 const std::string MAGIC_IDENTIFIER; 375 const int MAGIC_NUMBER; 338 376 }; 339 377
Note:
See TracChangeset
for help on using the changeset viewer.