C++ IP API  9.5.7
TCP & UDP for virtual user scripts
IpResponses.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include "VirtualUserInterface.h"
5 #include "Extractor.h"
6 #include "Ip.h"
7 #include "Exception.h"
8 
9 using namespace std;
10 
11 namespace Facilita
12 {
20  {
21  public:
23  BaseResponse();
25  BaseResponse(const string& error);
27  BaseResponse(const Exception& error);
29  BaseResponse(const BaseResponse& orig);
32  BaseResponse& operator=(const BaseResponse& other);
35  bool isError() const { return _code!=~0; }
37  const string& error() const {return _error;}
45  int code() const { return _code; }
46 
47  private:
48  #pragma warning (disable : 4251)
49  string _error;
50 
51  int _code;
52  };
53 
60  {
61  public:
63  DiscardResponse(int count=0);
65  DiscardResponse(const string& error);
67  DiscardResponse(const Exception& error);
68  DiscardResponse(const DiscardResponse& orig);
71  DiscardResponse& operator=(const DiscardResponse& other);
78  int count() const { return _count; }
79  private:
80  int _count;
81  };
82 
90  {
91  public:
95  ReceiveResponse(::VirtualUserInterface& vu, const string& data);
97  ReceiveResponse(::VirtualUserInterface& vu, const string& data, const string& error);
99  ReceiveResponse(::VirtualUserInterface& vu, const Exception& error);
101  ReceiveResponse(const ReceiveResponse& orig);
104  ReceiveResponse& operator=(const ReceiveResponse& other);
105 
106  private:
107  };
108 
116  {
117  public:
119  PatternResponse();
121  PatternResponse(::VirtualUserInterface& vu, const string& data, int patternIndex);
123  PatternResponse(::VirtualUserInterface& vu, const string& data, const string& error);
125  PatternResponse(::VirtualUserInterface& vu, const Exception& error);
127  PatternResponse(const PatternResponse& orig);
130  PatternResponse& operator=(const PatternResponse& other);
137  int index() const {return _index;}
138  private:
139  int _index;
140  };
141 }
int code() const
The numeric value of any error .
Definition: IpResponses.h:45
A means to search and extract information from a string.
Definition: Extractor.h:236
Objects of this class are returned by discard methods.
Definition: IpResponses.h:59
STL namespace.
The base class of Response classes.
Definition: IpResponses.h:19
#define IP_API
Definition: Ip.h:21
Objects of this class are returned by receive methods.
Definition: IpResponses.h:89
const string & error() const
A string describing the error that has occurred. Empty if no error has occurred
Definition: IpResponses.h:37
Definition: IpEndPoint.h:9
int count() const
discard methods return objects of this class.
Definition: IpResponses.h:78
The objects of this class are returned by receive methods.
Definition: IpResponses.h:115
int index() const
Objects of this class are returned by receive methods. The index property holds a non-negative intege...
Definition: IpResponses.h:137
bool isError() const
Has there been an error?
Definition: IpResponses.h:35