source: XMLIO_V2/dev/common/src/event_server.cpp @ 300

Last change on this file since 300 was 300, checked in by ymipsl, 12 years ago

nouvelle version de developpement de xios

  • nouvelle interface fortran
  • recodage complet de la couche de communication
  • et bien d'autres choses...

YM

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1#include "xmlioserver_spl.hpp"
2#include "buffer_in.hpp"
3#include "type.hpp"
4#include "event_server.hpp"
5#include "buffer_server.hpp"
6
7namespace xmlioserver
8{
9
10  void CEventServer::push(int rank,CServerBuffer* serverBuffer,char* startBuffer,int size)
11  {
12    CBufferIn buffer(startBuffer,size) ;
13    size_t timeLine ;
14    int myClassId ;
15    int myType ;
16    int myNbSender ;
17 
18    buffer>>size>>timeLine>>myNbSender>>myClassId>>myType ;
19 
20    if (subEvents.empty())
21    { 
22      nbSender=myNbSender ;
23      classId=myClassId;
24      type=myType ;
25    }
26    else
27    {
28      if (nbSender!=myNbSender || classId!=myClassId || type!=myType)
29        ERROR("void CEventServer::push(int rank,char* startBuffer,int size)",
30             "Callers of an event are not coherent") ;
31    }
32
33    SSubEvent ev ;
34    ev.rank=rank ;
35    ev.serverBuffer=serverBuffer ;
36    ev.buffer=new CBufferIn(buffer.ptr(),buffer.remain()) ;
37    ev.size=size ; 
38    subEvents.push_back(ev) ;
39 
40    if (subEvents.size()>nbSender)
41    {
42        ERROR("void CEventServer::push(int rank,CServerBuffer* serverBuffer,char* startBuffer,int size)",
43              "Callers of an event are not coherent") ;
44    }
45 
46  }
47
48  bool CEventServer::isFull(void) 
49  {
50    return (nbSender==subEvents.size()) ;
51  }
52
53  CEventServer::~CEventServer()
54  {
55    list<SSubEvent>::iterator it;
56
57    for(it=subEvents.begin();it!=subEvents.end();it++)
58    {
59      it->serverBuffer->freeBuffer(it->size) ;
60      delete it->buffer ;
61    }
62  }
63
64}
Note: See TracBrowser for help on using the repository browser.