Ignore:
Timestamp:
11/13/14 15:09:14 (9 years ago)
Author:
mhnguyen
Message:

Implementing buffer size auto-detection for mode client -server

+) Process xml tree in client side then send all the information to server
+) Only information enabled fields in enabled files are sent to server
+) Some important change in structure of code which must be refactored

Test
+) On Curie
+) Only mode client-server
+) Passed for all tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/buffer_server.cpp

    r501 r509  
    22#include "exception.hpp" 
    33#include "buffer_server.hpp" 
    4 #include "cxios.hpp" 
     4 
    55 
    66namespace xios 
    77{ 
    88 
    9   CServerBuffer::CServerBuffer(void) 
     9  CServerBuffer::CServerBuffer(StdSize buffSize) 
    1010  { 
    11     bufferSizeByClient=CXios::bufferSize*CXios::bufferServerFactorSize ; 
     11    bufferSizeByClient= buffSize * CXios::bufferServerFactorSize; //::bufferSize*CXios::bufferServerFactorSize ; 
    1212    size=bufferSizeByClient ; 
    1313    first=0 ; 
     
    2121    delete [] buffer ; 
    2222  } 
    23    
     23 
    2424 
    2525  bool CServerBuffer::isBufferFree(size_t count) 
    2626  { 
    2727    bool ret ; 
    28      
     28 
    2929    if (count==0) return true ; 
    30      
     30 
    3131    if (current>first) 
    3232    { 
     
    7272    return ret ; 
    7373  } 
    74    
     74 
    7575 
    7676  void* CServerBuffer::getBuffer(size_t count) 
    7777  { 
    7878    char* ret ; 
    79      
     79 
    8080    if (count==0) return buffer+current ; 
    81      
     81 
    8282    if (current>first) 
    8383    { 
     
    131131    return ret ; 
    132132  } 
    133    
     133 
    134134  void CServerBuffer::freeBuffer(size_t count) 
    135135  { 
    136136    if (count==0) return ; 
    137137 
    138     if (first==end-1)  
     138    if (first==end-1) 
    139139    { 
    140140      first=0 ; 
     
    145145    if (first<=current) 
    146146    { 
    147       if (first+count <current)  
     147      if (first+count <current) 
    148148      { 
    149149        first+=count ; 
     
    154154                 <<"cannot free required size in buffer") ; 
    155155      } 
    156      
     156 
    157157    } 
    158158    else 
     
    168168      } 
    169169    } 
    170   }       
    171         
     170  } 
     171 
    172172} 
Note: See TracChangeset for help on using the changeset viewer.