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

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
RevLine 
[3537]1#ifndef PCIEWRAP_H_SEEN
2#define PCIEWRAP_H_SEEN
[3623]3#include "brtypes.h"
[3537]4#include "machdefs.h"
[3623]5#include "racqumem.h"
6#include "brpaqu.h"
[3537]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; }
[3623]21 virtual ~PCIEWException() { }
[3537]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
[3623]29// Classe definissant l'interface des operations transfert DMA/PCIExpress
[3628]30class PCIEWrapperInterface {
[3623]31 public:
32 // Constructeur - fait l'initialisation
[3628]33 PCIEWrapperInterface() { }
[3623]34 // destructeur - libere la memoire allouee
[3628]35 virtual ~PCIEWrapperInterface() { }
[3537]36
[3623]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};
[3537]42
[3623]43// Classe de test Implementant l'interface PCIEWrapper sans DMA
[3628]44class TestPCIWrapperNODMA : public PCIEWrapperInterface {
[3623]45public:
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
54protected:
55 Byte* data_;
56 UInt32 size_;
57 UInt32 frame_counter_;
58 UInt64 timetag_;
59 UInt64 tottransfer_;
60 BRPaqChecker pchk_;
[3537]61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.