aboutsummaryrefslogtreecommitdiff
path: root/core/src/participant.cpp
blob: aa97e83bcb09cdda2d5dcda34e3e807f9be1681c (plain)
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
#include "turns/core/participant.hpp"

#include <glibmm/class.h>
#include <glibmm/refptr.h>

#include <typeinfo>
#include <utility>

namespace turns::core
{
  auto participant::create(Glib::ustring name, float priority, core::disposition disposition) -> Glib::RefPtr<participant>
  {
    return Glib::make_refptr_for_instance(new participant{name, priority, disposition});
  }

  participant::participant()
      : Glib::ObjectBase{typeid(participant)}
      , Glib::Object{}
  {
  }

  participant::participant(Glib::ustring name, float priority, core::disposition disposition)
      : participant()
  {
    m_name = name;
    m_priority = priority;
    m_disposition = disposition;
  }

  auto participant::operator<=>(participant const & other) const noexcept -> std::partial_ordering
  {
    return m_priority <=> other.m_priority;
  }

}  // namespace turns::core