Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Libs/includes/DivideNetworking/ByteBuffer.h

Diff revisions: vs.
  @@ -85,7 +85,8 @@
85 85 _rpos = _wpos = 0;
86 86 }
87 87
88 - template <typename T> void put(size_t pos,T value)
88 + template<typename T>
89 + void put(size_t pos,T value)
89 90 {
90 91 EndianConvert(value);
91 92 put(pos,(U8 *)&value,sizeof(value));
  @@ -308,14 +309,16 @@
308 309 _rpos += skip;
309 310 }
310 311
311 - template <typename T> T read()
312 + template<typename T>
313 + T read()
312 314 {
313 315 T r = read<T>(_rpos);
314 316 _rpos += sizeof(T);
315 317 return r;
316 318 }
317 319
318 - template <typename T> T read(size_t pos) const
320 + template<typename T>
321 + T read(size_t pos) const
319 322 {
320 323 if(pos + sizeof(T) > size())
321 324 throw ByteBufferException(false, pos, sizeof(T), size());
  @@ -440,8 +443,9 @@
440 443 {
441 444 }
442 445 private:
443 - // limited for internal use because can "append" any unexpected type (like pointer and etc) with hard detection problem
444 - template <typename T> void append(T value)
446 + /// limited for internal use because can "append" any unexpected type (like pointer and etc) with hard detection problem
447 + template<typename T>
448 + void append(T value)
445 449 {
446 450 EndianConvert(value);
447 451 append((U8 *)&value, sizeof(value));
  @@ -452,7 +456,7 @@
452 456 std::vector<U8> _storage;
453 457 };
454 458
455 - template <typename T>
459 + template<typename T>
456 460 inline ByteBuffer &operator<<(ByteBuffer &b, Networking::vector3 const& v)
457 461 {
458 462 b << v.x;
  @@ -461,7 +465,7 @@
461 465 return b;
462 466 }
463 467
464 - template <typename T>
468 + template<typename T>
465 469 inline ByteBuffer &operator>>(ByteBuffer &b,Networking::vector3 &v)
466 470 {
467 471 b >> v.x;
  @@ -470,7 +474,7 @@
470 474 return b;
471 475 }
472 476
473 - template <typename T>
477 + template<typename T>
474 478 inline ByteBuffer &operator<<(ByteBuffer &b, std::vector<T> const& v)
475 479 {
476 480 b << (U32)v.size();
  @@ -481,7 +485,7 @@
481 485 return b;
482 486 }
483 487
484 - template <typename T>
488 + template<typename T>
485 489 inline ByteBuffer &operator>>(ByteBuffer &b, std::vector<T> &v)
486 490 {
487 491 U32 vsize;
  @@ -496,7 +500,7 @@
496 500 return b;
497 501 }
498 502
499 - template <typename T>
503 + template<typename T>
500 504 inline ByteBuffer &operator<<(ByteBuffer &b, std::list<T> const& v)
501 505 {
502 506 b << (U32)v.size();
  @@ -507,7 +511,7 @@
507 511 return b;
508 512 }
509 513
510 - template <typename T>
514 + template<typename T>
511 515 inline ByteBuffer &operator>>(ByteBuffer &b, std::list<T> &v)
512 516 {
513 517 U32 vsize;
  @@ -522,7 +526,7 @@
522 526 return b;
523 527 }
524 528
525 - template <typename K, typename V>
529 + template<typename K, typename V>
526 530 inline ByteBuffer &operator<<(ByteBuffer &b, std::map<K, V> &m)
527 531 {
528 532 b << (U32)m.size();
  @@ -533,7 +537,7 @@
533 537 return b;
534 538 }
535 539
536 - template <typename K, typename V>
540 + template<typename K, typename V>
537 541 inline ByteBuffer &operator>>(ByteBuffer &b, std::map<K, V> &m)
538 542 {
539 543 U32 msize;