~vibhavp/ubuntu/saucy/urg/merge-from-debian

« back to all changes in this revision

Viewing changes to src/cpp/connection/TcpipSocket.h

  • Committer: Bazaar Package Importer
  • Author(s): Albert Huang
  • Date: 2011-05-20 11:33:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110520113303-u8niofzwzcea0osk
Tags: 0.8.12-1
* New upstream release (closes: #624987)
* Add debian/watch file
* Bump standards-version to 3.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
  \author Satofumi KAMIMURA
9
9
 
10
 
  $Id: TcpipSocket.h 1414 2009-10-14 23:14:02Z satofumi $
 
10
  $Id: TcpipSocket.h 1817 2010-05-09 09:04:32Z satofumi $
11
11
*/
12
12
 
13
13
#include "Connection.h"
 
14
#include <string>
14
15
#include <memory>
15
16
 
16
17
 
17
18
namespace qrk
18
19
{
19
 
  class SocketSet;
20
 
 
21
 
 
22
 
  /*!
23
 
    \brief TCP/IP �ʐM
24
 
  */
25
 
  class TcpipSocket : public Connection
26
 
  {
27
 
  public:
28
 
    TcpipSocket(void);
29
 
 
30
 
 
31
 
    /*!
32
 
      \brief �R���X�g���N�^
33
 
 
34
 
      \param[in] socket �ʐM�\�P�b�g
35
 
    */
36
 
    TcpipSocket(void* socket);
37
 
 
38
 
 
39
 
    /*!
40
 
      \brief �R���X�g���N�^
41
 
 
42
 
      \param[in] socket_set �ʐM�\�P�b�g�Ǘ�
43
 
      \param[in] socket �ʐM�\�P�b�g
44
 
    */
45
 
    TcpipSocket(SocketSet* socket_set, void* socket = NULL);
46
 
 
47
 
    ~TcpipSocket(void);
48
 
 
49
 
    const char* what(void) const;
50
 
 
51
 
    bool connect(const char* host, long port);
52
 
    void disconnect(void);
53
 
    bool setBaudrate(long baudrate);
54
 
    long baudrate(void) const;
55
 
    bool isConnected(void) const;
56
 
    int send(const char* data, size_t count);
57
 
    int receive(char* data, size_t count, int timeout);
58
 
    size_t size(void) const;
59
 
    void flush(void);
60
 
    void clear(void);
61
 
    void ungetc(const char ch);
62
 
 
63
 
  private:
64
 
    TcpipSocket(const TcpipSocket& rhs);
65
 
    TcpipSocket& operator = (const TcpipSocket& rhs);
66
 
 
67
 
    struct pImpl;
68
 
    const std::auto_ptr<pImpl> pimpl;
69
 
  };
 
20
    class SocketSet;
 
21
 
 
22
 
 
23
    //! TCP/IP �ʐM
 
24
    class TcpipSocket : public Connection
 
25
    {
 
26
    public:
 
27
        TcpipSocket(void);
 
28
 
 
29
 
 
30
        /*!
 
31
          \brief �R���X�g���N�^
 
32
 
 
33
          \param[in] socket �ʐM�\�P�b�g
 
34
        */
 
35
        TcpipSocket(void* socket);
 
36
 
 
37
 
 
38
        /*!
 
39
          \brief �R���X�g���N�^
 
40
 
 
41
          \param[in] socket_set �ʐM�\�P�b�g�Ǘ�
 
42
          \param[in] socket �ʐM�\�P�b�g
 
43
        */
 
44
        TcpipSocket(SocketSet* socket_set, void* socket = NULL);
 
45
 
 
46
        ~TcpipSocket(void);
 
47
 
 
48
        const char* what(void) const;
 
49
 
 
50
        bool connect(const char* host, long port);
 
51
        void disconnect(void);
 
52
        bool setBaudrate(long baudrate);
 
53
        long baudrate(void) const;
 
54
        bool isConnected(void) const;
 
55
        int send(const char* data, size_t count);
 
56
        int receive(char* data, size_t count, int timeout);
 
57
        size_t size(void) const;
 
58
        void flush(void);
 
59
        void clear(void);
 
60
        void ungetc(const char ch);
 
61
 
 
62
    private:
 
63
        TcpipSocket(const TcpipSocket& rhs);
 
64
        TcpipSocket& operator = (const TcpipSocket& rhs);
 
65
 
 
66
        struct pImpl;
 
67
        const std::auto_ptr<pImpl> pimpl;
 
68
    };
70
69
}
71
70
 
72
71
#endif /* !QRK_TCPIP_SOCKET_H */