PaCO++  0.05
Identity.h
Go to the documentation of this file.
1 #ifndef _IDENTITY_H
2 #define _IDENTITY_H
3 
5 #include "IdentityIdl.h"
6 
7 using namespace std;
8 
12 
14 {
15 private:
17  // Client & Server side
18 
19  unsigned _config; // vector of bit describing which elements have been configured (cf .cc)
20 
21  PaCO::PacoTopology_t _sTopo; // topology of the source (sender) -- SET
22  PaCO::PacoTopology_t _dTopo; // topology of the destination (receiver) -- SET
23 
24  unsigned _nodeRank; // id of the node (either source or destination) -- SET
25  unsigned _llen; // local vector size: in element -- SET
26  unsigned _unitsize; // #bytes of one element -- SET
27 
29  // Client Side
30  char* _clientBuffer; // pointer to the user data (set)
31  IdentityLib::IdentityDescr _clientDescr; // contains the descr exchange between sender & destination -- SET indirectly
32 
34  // Server Side
35  unsigned long _serverToReceived; // #of element yet to be received (during an invocation)
36  char* _serverBuffer; // Buffer where to receive the data
37 
38  IdentityLib::IdentityDescr* _serverDescr; // contains the descr exchange between sender & destination -- SET indirectly
39 
42 
43 public:
44  Identity();
45  virtual ~Identity();
46 
47  // Common
48  virtual void setSourceTopology(PaCO::PacoTopology_t topo);
49  virtual PaCO::PacoTopology_t getSourceTopology();
50  virtual void setDestTopology(PaCO::PacoTopology_t topo);
51  virtual PaCO::PacoTopology_t getDestTopology();
52  virtual void setNodeRank(long Rank);
53  virtual long getNodeRank();
54  virtual void setCommunicator(void * group) {}
55 
56  // Data description API
57  void setEltSize(unsigned long size);
58  void setLocalNbElt(unsigned long elt_nb);
59 
60  // Client Side
61  virtual PieceToSend* computePiecesToSend(unsigned& size);
62  virtual void setDataPtr(void* dataPtr);
63  virtual void* getClientData(void *pid, int server_node, long & size, long & length, bool & end);
64  virtual void* getDescr();
65  virtual void clientFree(); // true if com schedule to be freed
66 
67 
68  // Server Side
69  virtual bool insertData(void* rcptBuf, unsigned long element_nb);
70  virtual void setDescr(void * descr);
71 
72  virtual void* getServerData(long & length);
73  virtual void serverFree();
74 
75 };
76 
80 
82 {
83 
84  public:
86  virtual ~Identity_fab() {}
87 
89  {
90  return new Identity();
91  }
92 
93 };
94 
95 #endif
IdentityLib::IdentityDescr * _serverDescr
Definition: Identity.h:38
PaCO::PacoTopology_t _dTopo
Definition: Identity.h:22
char * _serverBuffer
Definition: Identity.h:36
PaCO::PacoTopology_t _sTopo
Definition: Identity.h:21
char * _clientBuffer
Definition: Identity.h:30
virtual void setCommunicator(void *group)
Definition: Identity.h:54
unsigned _config
Definition: Identity.h:19
Identity_fab()
Definition: Identity.h:85
unsigned _unitsize
Definition: Identity.h:26
virtual ~Identity_fab()
Definition: Identity.h:86
IdentityLib::IdentityDescr _clientDescr
Definition: Identity.h:31
unsigned _llen
Definition: Identity.h:25
DistributionLibrary * create()
Definition: Identity.h:88
unsigned _nodeRank
Definition: Identity.h:24
unsigned long _serverToReceived
Definition: Identity.h:35