Changeset 6786 for source/ariba/utility


Ignore:
Timestamp:
Nov 2, 2009, 1:31:19 AM (15 years ago)
Author:
mies
Message:

Changed Data to Message conversion constructor in Message to explicit
Fixed some general bugs in Data: operator<<
Fixed bug in DHTMessage: allow unspecified key/values
Added local DHT message delivery
Adapted sources to work with gcc 4.4.1

Location:
source/ariba/utility
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/addressing/facades/address_v.hpp

    r5284 r6786  
    22#define ADDRESS_V_H_
    33
     4#include <stdint.h>
    45#include <string>
    56#include <iostream>
  • source/ariba/utility/addressing/facades/to_bytes_v.hpp

    r5284 r6786  
    55
    66#include <memory>
     7#include <stdint.h>
    78#include "vfacade.hpp"
    89
  • source/ariba/utility/addressing/port_address.hpp

    r5284 r6786  
    55
    66#include<string>
     7#include<cstdio>
     8
    79#include<boost/tr1/functional.hpp>
    810
  • source/ariba/utility/messages/Message.h

    r5484 r6786  
    105105         * data.
    106106         */
    107         inline Message( const Data& data ) :
     107        explicit inline Message( const Data& data ) :
    108108                srcAddr(NULL),destAddr(NULL), releasePayload(true) {
    109109                this->payload = data.clone();
  • source/ariba/utility/serialization/Data.hpp

    r5870 r6786  
    4949template<typename T = uint8_t, typename DataModel = DefaultDataModel<uint8_t> > class DataTpl;
    5050typedef DataTpl<> Data;
    51 template<typename T, typename DataModel> std::ostream& operator<<(std::ostream& stream, DataTpl<T, DataModel>& data);
     51template<typename T, typename DataModel> std::ostream& operator<<(std::ostream& stream, const DataTpl<T, DataModel>& data);
    5252
    5353//== internal includes ==
     
    324324};
    325325
    326 /* default human readable text output */
    327 template<typename T, typename DataModel>
    328 std::ostream& operator<<(std::ostream& stream, DataTpl<T, DataModel>& data) {
    329         stream << "[" << bitstr(data.getBuffer(), data.getLength(), 4)
    330                         << "|'";
    331         char* buffer = (char*) data.getBuffer();
    332         for (size_t i = 0; i < data.getLength() / 8; i++) {
    333                 char c = buffer[i] < 32 ? '.' : buffer[i];
    334                 stream << c;
    335         }
    336         stream << "']";
    337         return stream;
    338 }
    339 
    340326/* unspecified type */
    341327template<typename T, typename DataModel>
     
    397383
    398384        finline int32_t length() const {
    399                 return bufferLen;
     385                return (bufferLen == -1) ? 0 : bufferLen;
    400386        }
    401387
     
    442428}sznEnd();
    443429
     430/* default human readable text output */
     431template<typename T, typename DataModel>
     432std::ostream& operator<<(std::ostream& stream, const DataTpl<T, DataModel>& data) {
     433        stream << "[" << bitstr(data.getBuffer(), data.getLength(), 4)
     434                        << "|'";
     435        const char* buffer = (const char*) data.getBuffer();
     436        for (size_t i = 0; i < data.getLength() / 8; i++) {
     437                char c = buffer[i] < 32 ? '.' : buffer[i];
     438                stream << c;
     439        }
     440        stream << "']";
     441        return stream;
     442}
    444443#endif /* DATA_HPP_ */
  • source/ariba/utility/transport/tcpip/protlib/address.cpp

    r5876 r6786  
    534534        char ipstr[INET6_ADDRSTRLEN] = {0};
    535535        // look for /
    536         i = strchr(str,'/');
     536        i = strchr((char*)str,'/');
    537537        if (i) {
    538538                iplen = i-str;
Note: See TracChangeset for help on using the changeset viewer.