Ignore:
Timestamp:
06/14/11 16:20:27 (13 years ago)
Author:
hozdoba
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/client.cpp

    r199 r214  
    1919   }  
    2020    
     21   ///-------------------------------------------------------------- 
     22 
     23   boost::shared_ptr<CClient> CClient::Client; 
     24 
     25   ///-------------------------------------------------------------- 
     26 
     27   boost::shared_ptr<CClient> CClient::CreateClient(MPIComm comm_client_server) 
     28   { 
     29      if (CClient::Client.get() != NULL) 
     30         CClient::Client = boost::shared_ptr<CClient>(new CClient(comm_client_server)); 
     31      return (CClient::GetClient()); 
     32   } 
     33 
     34   ///-------------------------------------------------------------- 
     35 
     36   boost::shared_ptr<CClient> CClient::GetClient(void) 
     37   { 
     38      return (CClient::Client); 
     39   } 
     40 
    2141   ///-------------------------------------------------------------- 
    2242    
     
    7191      this->bpair.getCurrentBuffer().appendInt(timestep); 
    7292   } 
     93 
     94   //--------------------------------------------------------------- 
     95 
     96   void CClient::setTimestep(const date::CDuration & duration) 
     97   { 
     98      StdString durationstr = duration.toString(); 
     99      this->bpair.prepareRequest(1, 2, &durationstr, 
     100                                       CLinearBuffer::NULL_ARG, 
     101                                       CLinearBuffer::NULL_ARG, 
     102                                       CLinearBuffer::NULL_ARG); 
     103      this->bpair.getCurrentBuffer().appendString(durationstr); 
     104   } 
    73105    
    74106   //--------------------------------------------------------------- 
    75107    
    76    void CClient::sendData(const StdString & fieldId, const ARRAY(float, 1) dataArray) 
     108   void CClient::sendData 
     109      (const StdString & fieldId, const StdString & fileId, const ARRAY(float, 1) dataArray) 
    77110   { 
    78       this->bpair.prepareRequest(2, 0, &fieldId, &dataArray, 
    79                                        CLinearBuffer::NULL_ARG, 
     111      this->bpair.prepareRequest(2, 0, &fieldId, &fileId, &dataArray, 
    80112                                       CLinearBuffer::NULL_ARG); 
    81113      this->bpair.getCurrentBuffer().appendString(fieldId); 
     114      this->bpair.getCurrentBuffer().appendString(fileId); 
    82115      this->bpair.getCurrentBuffer().appendFloatArray(dataArray); 
    83116   } 
     
    85118   //--------------------------------------------------------------- 
    86119    
    87    void CClient::sendData(const StdString & fieldId, const ARRAY(double, 1) dataArray) 
     120   void CClient::sendData 
     121      (const StdString & fieldId, const StdString & fileId, const ARRAY(double, 1) dataArray) 
    88122   { 
    89       this->bpair.prepareRequest(2, 1, &fieldId, &dataArray, 
    90                                        CLinearBuffer::NULL_ARG, 
     123      this->bpair.prepareRequest(2, 1, &fieldId, &fileId, &dataArray, 
    91124                                       CLinearBuffer::NULL_ARG); 
    92125      this->bpair.getCurrentBuffer().appendString(fieldId); 
     126      this->bpair.getCurrentBuffer().appendString(fileId); 
    93127      this->bpair.getCurrentBuffer().appendDoubleArray(dataArray); 
    94128   } 
Note: See TracChangeset for help on using the changeset viewer.