YAMI4 Core Library 2.0.0
Messaging Solution for Distributed Systems
Loading...
Searching...
No Matches
channel_descriptor.h
1// Copyright Maciej Sobczak 2008-2022.
2// This file is part of YAMI4.
3// See the package-level LICENSE.txt file.
4
5#ifndef YAMICORE_CHANNEL_DESCRIPTOR_H_INCLUDED
6#define YAMICORE_CHANNEL_DESCRIPTOR_H_INCLUDED
7
8#include "dll.h"
9
10#include <cstddef>
11
12namespace yami
13{
14
15namespace core
16{
17
27{
28public:
36 : index_(0), sequence_number_(0)
37 {
38 }
39
40 // used internally to create the descriptor that is then
41 // returned to the user code
42 channel_descriptor(std::size_t index, std::size_t sequence_number)
43 : index_(index), sequence_number_(sequence_number)
44 {
45 }
46
47 // used internally
48 void get_details(std::size_t & index, std::size_t & sequence_number) const
49 {
50 index = index_;
51 sequence_number = sequence_number_;
52 }
53
61 bool operator==(const channel_descriptor & other) const
62 {
63 return index_ == other.index_ &&
64 sequence_number_ == other.sequence_number_;
65 }
66
71 bool operator!=(const channel_descriptor & other) const
72 {
73 return (*this == other) == false;
74 }
75
76private:
77 std::size_t index_;
78 std::size_t sequence_number_;
79};
80
81} // namespace core
82
83} // namespace yami
84
85#endif // YAMICORE_CHANNEL_DESCRIPTOR_H_INCLUDED
Descriptor handle for the physical channel.
Definition: channel_descriptor.h:27
bool operator==(const channel_descriptor &other) const
Comparison operator.
Definition: channel_descriptor.h:61
channel_descriptor()
Constructor.
Definition: channel_descriptor.h:35
bool operator!=(const channel_descriptor &other) const
Comparison operator.
Definition: channel_descriptor.h:71
Namespace devoted for everything related to YAMI4.
Definition: agent.h:14