libdrmconf 0.13.3
A library to program DMR radios.
Loading...
Searching...
No Matches
opengd77_callsigndb.hh
1#ifndef OPENGD77CALLSIGNDB_HH
2#define OPENGD77CALLSIGNDB_HH
3
4#include "opengd77base_callsigndb.hh"
5#include "userdatabase.hh"
6
20{
21 Q_OBJECT
22
23public:
25 explicit OpenGD77CallsignDB(QObject *parent=nullptr);
26
27 static constexpr unsigned int size0() { return 0x40000; }
28 static constexpr unsigned int size1() { return 0x48000; }
29
31 bool encode(UserDatabase *calldb, const Flags &selection=Flags(),
32 const ErrorStack &err=ErrorStack());
33
34public:
38 static constexpr unsigned int entries0() {
39 return (size0()-DatabaseHeaderElement::size())/DatabaseEntryElement::size();
40 }
41
42 static constexpr unsigned int entries1() {
43 return size1()/DatabaseEntryElement::size();
44 }
45 static constexpr unsigned int entries() {
46 return entries0() + entries1();
47 }
48 };
49
50protected:
52 struct Offset {
54 static constexpr unsigned int header() { return 0x030000; }
55 static constexpr unsigned int entries0() { return header() + DatabaseHeaderElement::size(); }
56 static constexpr unsigned int entries1() { return 0x0b8000; }
58 };
59};
60
61#endif // OPENGD77CALLSIGNDB_HH
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:22
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
OpenGD77BaseCallsignDB(QObject *parent=nullptr)
Constructor.
Definition opengd77base_callsigndb.cc:142
OpenGD77CallsignDB(QObject *parent=nullptr)
Constructor.
Definition opengd77_callsigndb.cc:11
bool encode(UserDatabase *calldb, const Flags &selection=Flags(), const ErrorStack &err=ErrorStack())
Encodes as many entries as possible of the given user-database.
Definition opengd77_callsigndb.cc:19
Auto-updating DMR user database.
Definition userdatabase.hh:24
Some limits for this callsign DB.
Definition opengd77base_callsigndb.hh:149
Some limits of the callsign DB.
Definition opengd77_callsigndb.hh:36
static constexpr unsigned int entries0()
Number of entries, segment 0.
Definition opengd77_callsigndb.hh:38
static constexpr unsigned int entries1()
Number of entries, segment 1.
Definition opengd77_callsigndb.hh:42
Some internal offsets within the callsign db.
Definition opengd77_callsigndb.hh:52