TestProtocol.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // Copyright (C) 2013 Opensim Ltd.
  3. //
  4. // This program is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser General Public License
  6. // as published by the Free Software Foundation; either version 2
  7. // of the License, or (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. //
  17. // author: Levente Meszaros (levy@omnetpp.org)
  18. //
  19. #ifndef __INET_TESTPROTOCOL_H_
  20. #define __INET_TESTPROTOCOL_H_
  21. #include "inet/common/INETDefs.h"
  22. #include "inet/common/lifecycle/ILifecycle.h"
  23. namespace inet {
  24. class INET_API TestProtocol : public cSimpleModule, public ILifecycle {
  25. private:
  26. bool connectionOpen;
  27. bool dataSent;
  28. cMessage sendOpen;
  29. cMessage sendClose;
  30. cMessage sendData;
  31. IDoneCallback * doneCallback;
  32. public:
  33. TestProtocol() { }
  34. virtual bool handleOperationStage(LifecycleOperation *operation, int stage, IDoneCallback *doneCallback);
  35. protected:
  36. virtual void initialize(int stage);
  37. virtual void handleMessage(cMessage * message);
  38. };
  39. }
  40. #endif