Changeset 6921 for source/ariba/utility/serialization/DataStream.hpp
- Timestamp:
- Nov 13, 2009, 3:50:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/serialization/DataStream.hpp
r6919 r6921 516 516 517 517 /* array and vector support */ 518 template<typename T , bool staticArray = false>518 template<typename T> 519 519 class ArrayTpl : public ExplicitSerializer { 520 520 private: … … 524 524 public: 525 525 finline ArrayTpl( T*& array, size_t length ) : 526 v(0), l(length) {} 527 528 sznMethodBegin(X) 529 if (X.isDeserializer() && !staticArray) v = new T[l]; 526 v(array), l(length) {} 527 528 sznMethodBegin(X) 529 if (X.isDeserializer()) v = new T[l]; 530 for (size_t i=0; i<l; i++) X && v[i]; 531 sznMethodEnd() 532 }; 533 534 template<typename T> 535 class StaticArrayTpl : public ExplicitSerializer { 536 private: 537 T* v; 538 size_t l; 539 540 public: 541 finline StaticArrayTpl( T* array, size_t length ) : 542 v(array), l(length) {} 543 544 sznMethodBegin(X) 530 545 for (size_t i=0; i<l; i++) X && v[i]; 531 546 sznMethodEnd() … … 559 574 560 575 template<typename T> 561 finline ArrayTpl<T,true> static_A( T*&array, size_t length ) {562 return ArrayTpl<T, true>(array,length);576 finline StaticArrayTpl<T> static_A( T* array, size_t length ) { 577 return StaticArrayTpl<T>(array,length); 563 578 } 564 579
Note:
See TracChangeset
for help on using the changeset viewer.