source: Sophya/trunk/AddOn/TAcq/pciewrap.h@ 3643

Last change on this file since 3643 was 3643, checked in by ansari, 16 years ago

Importation des modifs effectuees sur pc-sitr2 pour l'acquisition - Reza 27/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
15using namespace std;
16
17class 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
30class 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 void StartTransfers() { return; };
39 virtual Byte* GetData() = 0;
40 virtual UInt64 TotTransferBytes() = 0;
41 virtual void PrintStatus(ostream& os) = 0;
42};
43
44// Classe de test Implementant l'interface PCIEWrapper sans DMA
45class TestPCIWrapperNODMA : public PCIEWrapperInterface {
46public:
47 TestPCIWrapperNODMA(UInt32 sz);
48 virtual ~TestPCIWrapperNODMA();
49
50 virtual UInt32 TransferSize() ;
51 virtual Byte* GetData() ;
52 virtual UInt64 TotTransferBytes() ;
53 virtual void PrintStatus(ostream& os) ;
54
55protected:
56 Byte* data_;
57 Byte* srcdata_;
58 UInt32 size_;
59 UInt32 frame_counter_;
60 UInt64 timetag_;
61 UInt64 tottransfer_;
62 BRPaqChecker pchk_;
63};
64
65#endif
Note: See TracBrowser for help on using the repository browser.