|
Revision 550, 0.8 kB
(checked in by zhibinwu, 3 years ago)
|
|
adding debugging mode w/o OML for otg & otr (not otf), fixing a bug in otg.cpp to parse run time options
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | #ifndef ORBIT_APP_H |
|---|
| 2 | #define ORBIT_APP_H |
|---|
| 3 | |
|---|
| 4 | #include "packet.h" |
|---|
| 5 | #include "address.h" |
|---|
| 6 | #include <fstream> |
|---|
| 7 | using namespace std; |
|---|
| 8 | /** Abstract base class for all kinds of OTG-based applications |
|---|
| 9 | * This design allow we derive different oml settings for different application |
|---|
| 10 | * also provides an option to turn off OML |
|---|
| 11 | */ |
|---|
| 12 | |
|---|
| 13 | class OrbitApp |
|---|
| 14 | { |
|---|
| 15 | public: |
|---|
| 16 | inline OrbitApp(){} |
|---|
| 17 | virtual ~OrbitApp(){} |
|---|
| 18 | virtual void init(int *argc, const char* argv[], char* logopt)= 0; |
|---|
| 19 | inline void close () {if(!useOML_)fp_.close();} |
|---|
| 20 | virtual void omlSenderReport(Packet *p)= 0; |
|---|
| 21 | virtual void omlReceiverReport(Packet *p)= 0 ; |
|---|
| 22 | virtual void omlDemultiplexReport(int flowid, Address* srcAddr)=0; |
|---|
| 23 | protected: |
|---|
| 24 | char* appName_; |
|---|
| 25 | bool useOML_; ///<turn on/off OML integration |
|---|
| 26 | fstream fp_; ///<file name of debug log |
|---|
| 27 | }; |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | #endif |
|---|