1 2 /* Web Polygraph http://www.web-polygraph.org/ 3 * Copyright 2003-2011 The Measurement Factory 4 * Licensed under the Apache License, Version 2.0 */ 5 6 #ifndef POLYGRAPH__BEEP_RAWBEEPMSG_H 7 #define POLYGRAPH__BEEP_RAWBEEPMSG_H 8 9 #include "xstd/String.h" 10 11 class RawBeepMsg { 12 public: 13 enum Types { bmtNone = 0, bmtMsg, bmtRpy, bmtAns, bmtErr, bmtNul, bmtEnd }; 14 15 public: 16 RawBeepMsg(Types aType = bmtNone); 17 type()18 int type() const { return theType; } channel()19 int channel() const { return theChannel; } no()20 int no() const { return theNo; } seqNo()21 int seqNo() const { return theSeqNo; } ansNo()22 int ansNo() const { return theAnsNo; } image()23 const String &image() const { return theImage; } 24 type(int aType)25 void type(int aType) { theType = aType; } channel(int aChannel)26 void channel(int aChannel) { theChannel = aChannel; } no(int aNo)27 void no(int aNo) { theNo = aNo; } seqNo(int aNo)28 void seqNo(int aNo) { theSeqNo = aNo; } ansNo(int aNo)29 void ansNo(int aNo) { theAnsNo = aNo; } image(const String & anImage)30 void image(const String &anImage) { theImage = anImage; } 31 32 const String &typeStr() const; 33 void replyTo(const RawBeepMsg &msg); // form a reply 34 35 protected: 36 int theType; 37 int theChannel; 38 int theNo; 39 int theSeqNo; 40 int theAnsNo; 41 String theImage; 42 }; 43 44 #endif 45