CARMA C++
NetStr.h
Go to the documentation of this file.
1 #ifndef NETSTR_H
2 #define NETSTR_H
3 
13 
14 namespace sza {
15  namespace util {
16 
21  class NetStr {
22  public:
23 
27  NetStr();
28 
32  NetStr(int fd, unsigned long readSize, unsigned long sendSize);
33 
37  virtual ~NetStr();
38 
42  NetReadStr* getReadStr();
43 
47  NetSendStr* getSendStr();
48 
52  void attach(int fd);
53 
57  void setReadBuffer(unsigned int* buffer, unsigned int size);
58 
62  void setSendBuffer(unsigned int* buffer, unsigned int size);
63 
67  int getFd();
68 
72  NetSendStr::NetSendId send();
73 
77  NetReadStr::NetReadId read();
78 
79  private:
80 
81  int fd_;
82  NetReadStr* netReadStr_;
83  NetSendStr* netSendStr_;
84 
85  }; // End class NetStr
86 
87  }; // End namespace util
88 }; // End namespace sza
89 
90 #endif // End #ifndef
91 
92 
NetStr()
Constructor.
Started: Sun Feb 29 15:29:37 UTC 2004.
Started: Sun Feb 29 15:29:37 UTC 2004.
void setSendBuffer(unsigned int *buffer, unsigned int size)
Attach this network send buffer to a file descriptor.
Class for managing a read buffer and a send buffer both attached to the same file descriptor...
Definition: NetStr.h:21
NetReadStr::NetReadId read()
Read a message.
virtual ~NetStr()
Destructor.
int getFd()
Return the fd to which we are currently attached.
NetSendStr::NetSendId send()
Send a message.
void setReadBuffer(unsigned int *buffer, unsigned int size)
Attach this network read buffer to a file descriptor.
NetSendStr * getSendStr()
Get a reference to our NetSendStr object.
NetReadStr * getReadStr()
Get a reference to our NetReadStr object.
void attach(int fd)
Attach our network buffers to a file descriptor.