Last change
on this file since 3628 was 3628, checked in by ansari, 16 years ago |
PCIEWrapper renomme en PCIEWrapperInterface , Reza 21/05/2009
|
File size:
1.6 KB
|
Line | |
---|
1 | #ifndef PCIEWRAP_H_SEEN
|
---|
2 | #define PCIEWRAP_H_SEEN
|
---|
3 | #include "brtypes.h"
|
---|
4 | #include "machdefs.h"
|
---|
5 | #include "racqumem.h"
|
---|
6 | #include "brpaqu.h"
|
---|
7 | #include <string>
|
---|
8 |
|
---|
9 | /*
|
---|
10 | Classe interface aux fonctions d'I/O PCIExpress
|
---|
11 | pour la carte de reception optique BAORadio
|
---|
12 | R. Ansari Juin 2008
|
---|
13 | */
|
---|
14 |
|
---|
15 | using namespace std;
|
---|
16 |
|
---|
17 | class PCIEWException {
|
---|
18 | public:
|
---|
19 | explicit PCIEWException(const char * m) { msg = m; }
|
---|
20 | explicit PCIEWException(const string& m) { msg = m; }
|
---|
21 | virtual ~PCIEWException() { }
|
---|
22 | virtual string const& Msg() const {return msg;}
|
---|
23 | virtual const char* what() {return msg.c_str(); }
|
---|
24 | private:
|
---|
25 | string msg;
|
---|
26 | };
|
---|
27 |
|
---|
28 |
|
---|
29 | // Classe definissant l'interface des operations transfert DMA/PCIExpress
|
---|
30 | class PCIEWrapperInterface {
|
---|
31 | public:
|
---|
32 | // Constructeur - fait l'initialisation
|
---|
33 | PCIEWrapperInterface() { }
|
---|
34 | // destructeur - libere la memoire allouee
|
---|
35 | virtual ~PCIEWrapperInterface() { }
|
---|
36 |
|
---|
37 | virtual UInt32 TransferSize() = 0;
|
---|
38 | virtual Byte* DoTransferData(int numbuff=0) = 0;
|
---|
39 | virtual UInt64 TotTransferBytes() = 0;
|
---|
40 | virtual void PrintStatus(ostream& os) = 0;
|
---|
41 | };
|
---|
42 |
|
---|
43 | // Classe de test Implementant l'interface PCIEWrapper sans DMA
|
---|
44 | class TestPCIWrapperNODMA : public PCIEWrapperInterface {
|
---|
45 | public:
|
---|
46 | TestPCIWrapperNODMA(UInt32 sz);
|
---|
47 | virtual ~TestPCIWrapperNODMA();
|
---|
48 |
|
---|
49 | virtual UInt32 TransferSize() ;
|
---|
50 | virtual Byte* DoTransferData(int numbuff=0) ;
|
---|
51 | virtual UInt64 TotTransferBytes() ;
|
---|
52 | virtual void PrintStatus(ostream& os) ;
|
---|
53 |
|
---|
54 | protected:
|
---|
55 | Byte* data_;
|
---|
56 | UInt32 size_;
|
---|
57 | UInt32 frame_counter_;
|
---|
58 | UInt64 timetag_;
|
---|
59 | UInt64 tottransfer_;
|
---|
60 | BRPaqChecker pchk_;
|
---|
61 | };
|
---|
62 |
|
---|
63 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.