Ignore:
Timestamp:
Nov 13, 2009, 8:05:41 PM (15 years ago)
Author:
mies
Message:

replaced deprecated hash_map, hash_set classes with boost
added unsigned serialization
fixed more warnings
included -Wall to Makefile.am

Location:
source/ariba/utility/serialization
Files:
1 added
3 edited

Legend:

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

    r6786 r6922  
    4444#include <iostream>
    4545#include <boost/cstdint.hpp>
     46#include <boost/type_traits/make_unsigned.hpp>
    4647
    4748// forward declaration
     
    119120                template<typename X>
    120121                finline void get(X& value, size_t length = sizeof(X) * 8, if_int(X)) const {
    121                         _unsigned(value) = bitget<X> (bits.buffer(), index, length);
     122                        typedef typename boost::make_unsigned<X>::type unsigned_type;
     123                        _unsigned(value) = bitget<unsigned_type> (bits.buffer(), index, length);
    122124                }
    123125
  • source/ariba/utility/serialization/DataStream.hpp

    r6921 r6922  
    543543
    544544                sznMethodBegin(X)
    545                 for (size_t i=0; i<l; i++) X && v[i];
     545                        for (size_t i=0; i<l; i++) X && v[i];
    546546                sznMethodEnd()
    547547        };
  • source/ariba/utility/serialization/TestSerialization.cpp

    r3690 r6922  
    3737// [License]
    3838
     39#include "TestSerialization.h"
    3940#include "Data.hpp"
    4041#include "DataStream.hpp"
     
    5455        Aclass* vclass;
    5556        bool vcls;
     57        uint8_t* static_array;
    5658
    5759        Aclass(bool vcls = false) {
    5860                text = new char[80];
     61                static_array = new uint8_t[20];
     62                for (size_t i=0; i<20; i++) static_array[i] = i;
    5963                strcpy(text, "Hallo!");
    6064                str = "std::string:)";
     
    9498
    9599sznBeginDefault( Aclass, X ){
     100        double xpos;
    96101        X && x && b && I(y,6) && T(text) && T(str) && A(v,4) && I(z) && vcls;
     102        X && static_A(static_array,20);
     103        X && static_A( (uint8_t*)&xpos, 8 );
    97104        if (vcls) X && VO(vclass);
    98105}sznEnd()
     
    100107vsznDefault( Aclass );
    101108
    102 int main() {
     109int test_serialization() {
    103110        using namespace std;
    104111
Note: See TracChangeset for help on using the changeset viewer.