SObjectizer  5.8
Loading...
Searching...
No Matches
repository.cpp
Go to the documentation of this file.
1/*
2 * SObjectizer-5
3 */
4
5/*!
6 * \file
7 * \since
8 * v.5.5.4
9 *
10 * \brief Interfaces of data source and data sources repository.
11 */
12
13#include <so_5/stats/repository.hpp>
14
15namespace so_5
16{
17
18namespace stats
19{
20
21//
22// repository_t
23//
24void
26 source_t & what,
27 source_t *& head,
28 source_t *& tail ) noexcept
29 {
30 if( !tail )
31 {
32 // Addition to the empty list.
33 what.m_prev = what.m_next = nullptr;
34 head = &what;
35 }
36 else
37 {
38 tail->m_next = &what;
39 what.m_prev = tail;
40 what.m_next = nullptr;
41 }
42
43 tail = &what;
44 }
45
46void
48 source_t & what,
49 source_t *& head,
50 source_t *& tail ) noexcept
51 {
52 if( what.m_prev )
53 what.m_prev->m_next = what.m_next;
54 else
55 head = what.m_next;
56
57 if( what.m_next )
58 what.m_next->m_prev = what.m_prev;
59 else
60 tail = what.m_prev;
61 }
62
65 const source_t & what ) noexcept
66 {
67 return what.m_next;
68 }
69
70} /* namespace stats */
71
72} /* namespace so_5 */
An interface of data sources repository.
static source_t * source_list_next(const source_t &what) noexcept
Helper method for accessing next data source in the list.
static void source_list_add(source_t &what, source_t *&head, source_t *&tail) noexcept
Helper method for adding data source to existing list.
static void source_list_remove(source_t &what, source_t *&head, source_t *&tail) noexcept
Helper method for removing data source from existing list.
An interface of data source.
source_t * m_prev
Previous item in the data sources list.
source_t * m_next
Next item in the data sources list.
All stuff related to run-time monitoring and statistics.
Private part of message limit implementation.
Definition agent.cpp:33