libdrmconf 0.13.3
A library to program DMR radios.
Loading...
Searching...
No Matches
callsigndb.hh
1#ifndef CALLSIGNDB_HH
2#define CALLSIGNDB_HH
3
4#include "dfufile.hh"
5#include "transferflags.hh"
6
7
8// Forward decl.
9class UserDatabase;
10
15class CallsignDB : public DFUFile
16{
17 Q_OBJECT
18
19public:
22 class Flags: public TransferFlags {
23 public:
25 Flags(int64_t count=-1);
27 Flags(const Flags &other);
28
30 bool hasCountLimit() const;
32 size_t countLimit() const;
34 void setCountLimit(size_t n);
36 void clearCountLimit();
37
38 protected:
41 int64_t _count;
42 };
43
44protected:
46 explicit CallsignDB(QObject *parent=nullptr);
47
48public:
50 virtual ~CallsignDB();
51
53 virtual bool encode(UserDatabase *db, const Flags &selection=Flags(),
54 const ErrorStack &err=ErrorStack()) = 0;
55};
56
57#endif // CALLSIGNDB_HH
Controls the selection of callsigns from the UserDatabase to be encoded into the callsign db.
Definition callsigndb.hh:22
void clearCountLimit()
Clears the count limit.
Definition callsigndb.cc:37
bool hasCountLimit() const
Returns true if the selection has a limit on the number of callsigns to encode.
Definition callsigndb.cc:20
int64_t _count
Specifies the maximum amount of callsigns to add.
Definition callsigndb.hh:41
size_t countLimit() const
Returns the limit of callsigns to encode.
Definition callsigndb.cc:25
void setCountLimit(size_t n)
Sets the count limit.
Definition callsigndb.cc:32
Flags(int64_t count=-1)
Constructor.
Definition callsigndb.cc:7
CallsignDB(QObject *parent=nullptr)
Hidden constructor.
Definition callsigndb.cc:45
virtual ~CallsignDB()
Destructor.
Definition callsigndb.cc:51
virtual bool encode(UserDatabase *db, const Flags &selection=Flags(), const ErrorStack &err=ErrorStack())=0
Encodes the given user db into the device specific callsign db.
DFUFile(QObject *parent=nullptr)
Constructs an empty DFU file object.
Definition dfufile.cc:45
Implements a stack of error messages to provide a pretty formatted error traceback.
Definition errorstack.hh:43
TransferFlags()
Default constructor.
Definition transferflags.cc:3
Auto-updating DMR user database.
Definition userdatabase.hh:24