Ignore:
Timestamp:
May 26, 2009, 1:40:23 AM (15 years ago)
Author:
mies
Message:

Merged 20090512-mies-connectors changes r3472:r3689 into trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/serialization/DataStream.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef DATASTREAM_HPP_
     
    4242//== Library includes ==
    4343#include <boost/cstdint.hpp>
     44#include <boost/type_traits/make_unsigned.hpp>
     45
    4446#include <iostream>
    4547#include <vector>
     
    153155        template<typename X>
    154156        finline void remove(X& obj, if_uint(X)) {
     157                if (!isMeasure()) bits[index].get(obj);
     158                index += sizeof(X) * 8;
     159        }
     160
     161        /* support signed ints */
     162        template<typename X>
     163        finline void add(X& sobj, if_int(X)) {
     164                typedef typename boost::make_unsigned<X>::type UX;
     165                UX& obj = *((UX*)&sobj);
     166                if (!isMeasure())
     167                bitcpy( sobj, 0, bits.getBuffer(), index);
     168                index += sizeof(X) * 8;
     169        }
     170
     171        template<typename X>
     172        finline void remove(X& sobj, if_int(X)) {
     173                typedef typename boost::make_unsigned<X>::type UX;
     174                UX& obj = *((UX*)&sobj);
    155175                if (!isMeasure()) bits[index].get(obj);
    156176                index += sizeof(X) * 8;
Note: See TracChangeset for help on using the changeset viewer.