File: tcpchannel.h

package info (click to toggle)
amqp-cpp 4.3.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,384 kB
  • sloc: cpp: 10,021; ansic: 191; makefile: 95
file content (62 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
 *  TcpChannel.h
 *
 *  Extended channel that can be constructed on top of a TCP connection
 *
 *  @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
 *  @copyright 2015 - 2017 Copernica BV
 */

/**
 *  Include guard
 */
#pragma once

/**
 *  Set up namespace
 */
namespace AMQP {

/**
 *  Class definition
 */
class TcpChannel : public Channel
{
public:
    /**
     *  Constructor
     * 
     *  The passed in connection pointer must remain valid for the 
     *  lifetime of the channel. A constructor is thrown if the channel 
     *  cannot be connected (because the connection is already closed or
     *  because max number of channels has been reached)
     * 
     *  @param  connection
     *  @throws std::runtime_error
     */
    TcpChannel(TcpConnection *connection) :
        Channel(&connection->_connection) {}
        
    /**
     *  Destructor
     */
    virtual ~TcpChannel() {}

    /**
     *  Copying is not allowed.
     *  @param  other
     */
    TcpChannel(const TcpChannel &other) = delete;

    /**
     *  But movement is allowed
     *  @param  other
     */
    TcpChannel(TcpChannel &&other) = default;
};

/**
 *  End of namespace
 */
}