@@ -73,7 +73,7 @@ class CryptHash
73
73
74
74
void assign (Firebird::ICryptKeyCallback* callback);
75
75
76
- bool isValid () const
76
+ bool isValid () const noexcept
77
77
{
78
78
return m_valid;
79
79
}
@@ -85,7 +85,7 @@ class CryptHash
85
85
return m_value.begin ();
86
86
}
87
87
88
- int getLength () const
88
+ int getLength () const noexcept
89
89
{
90
90
return isValid () ? m_value.getCount () : -1 ;
91
91
}
@@ -108,7 +108,7 @@ class CryptCallbackRedirector :
108
108
void resetRedirect (Firebird::ICryptKeyCallback* newCallback);
109
109
bool operator ==(const CryptHash& h) const ;
110
110
111
- bool isValid () const
111
+ bool isValid () const noexcept
112
112
{
113
113
return m_hash.isValid ();
114
114
}
@@ -203,17 +203,17 @@ class Provider : public Firebird::GlobalStorage
203
203
// cancel execution of every connection
204
204
void cancelConnections ();
205
205
206
- const Firebird::string& getName () const { return m_name; }
206
+ const Firebird::string& getName () const noexcept { return m_name; }
207
207
208
208
virtual void initialize () = 0;
209
209
210
210
// Provider properties
211
- int getFlags () const { return m_flags; }
211
+ int getFlags () const noexcept { return m_flags; }
212
212
213
213
// Interprete status and put error description into passed string
214
214
virtual void getRemoteError (const Jrd::FbStatusVector* status, Firebird::string& err) const = 0;
215
215
216
- static const Firebird::string* generate (const Provider* item)
216
+ static const Firebird::string* generate (const Provider* item) noexcept
217
217
{
218
218
return &item->m_name ;
219
219
}
@@ -228,34 +228,34 @@ class Provider : public Firebird::GlobalStorage
228
228
const Firebird::string& role) const ;
229
229
230
230
// Protection against simultaneous attach database calls. Not sure we still
231
- // need it, but i believe it will not harm
232
- Firebird::Mutex m_mutex;
231
+ // need it, but I believe it will not harm
232
+ mutable Firebird::Mutex m_mutex;
233
233
234
234
Firebird::string m_name;
235
- Provider* m_next;
235
+ Provider* m_next = nullptr ;
236
236
237
237
class AttToConn
238
238
{
239
239
public:
240
240
Jrd::Attachment* m_att;
241
241
Connection* m_conn;
242
242
243
- AttToConn ()
243
+ AttToConn () noexcept
244
244
: m_att(NULL ),
245
245
m_conn (NULL )
246
246
{}
247
247
248
- AttToConn (Jrd::Attachment* att, Connection* conn)
248
+ AttToConn (Jrd::Attachment* att, Connection* conn) noexcept
249
249
: m_att(att),
250
250
m_conn(conn)
251
251
{}
252
252
253
- static const AttToConn& generate (const void *, const AttToConn& item)
253
+ static const AttToConn& generate (const void *, const AttToConn& item) noexcept
254
254
{
255
255
return item;
256
256
}
257
257
258
- static bool greaterThan (const AttToConn& i1, const AttToConn& i2)
258
+ static bool greaterThan (const AttToConn& i1, const AttToConn& i2) noexcept
259
259
{
260
260
return (i1.m_att > i2.m_att ) ||
261
261
(i1.m_att == i2.m_att && i1.m_conn > i2.m_conn );
@@ -266,7 +266,7 @@ class Provider : public Firebird::GlobalStorage
266
266
AttToConnMap;
267
267
268
268
AttToConnMap m_connections;
269
- int m_flags;
269
+ int m_flags = 0 ;
270
270
};
271
271
272
272
// Provider flags
@@ -292,13 +292,13 @@ class ConnectionsPool
292
292
// clear connection relation with pool
293
293
void delConnection (Jrd::thread_db* tdbb, Connection* conn, bool destroy);
294
294
295
- ULONG getIdleCount () const { return m_idleArray.getCount (); }
296
- ULONG getAllCount () const { return m_allCount; } ;
295
+ ULONG getIdleCount () const noexcept { return m_idleArray.getCount (); }
296
+ ULONG getAllCount () const noexcept { return m_allCount; }
297
297
298
- ULONG getMaxCount () const { return m_maxCount; }
298
+ ULONG getMaxCount () const noexcept { return m_maxCount; }
299
299
void setMaxCount (ULONG val);
300
300
301
- ULONG getLifeTime () const { return m_lifeTime; }
301
+ ULONG getLifeTime () const noexcept { return m_lifeTime; }
302
302
void setLifeTime (ULONG val);
303
303
304
304
// delete idle connections: all or older than lifetime
@@ -319,20 +319,23 @@ class ConnectionsPool
319
319
{
320
320
public:
321
321
// constructor for embedded into Connection instance
322
- explicit Data (Connection* conn)
322
+ explicit Data (Connection* conn) noexcept
323
323
{
324
324
clear ();
325
325
m_conn = conn;
326
326
}
327
327
328
- ConnectionsPool* getConnPool () const { return m_connPool; }
328
+ Data (const Data&) = delete ;
329
+ Data& operator =(const Data&) = delete ;
330
+
331
+ ConnectionsPool* getConnPool () const noexcept { return m_connPool; }
329
332
330
- static const Data& generate (const Data* item)
333
+ static const Data& generate (const Data* item) noexcept
331
334
{
332
335
return *item;
333
336
}
334
337
335
- static bool greaterThan (const Data& i1, const Data& i2)
338
+ static bool greaterThan (const Data& i1, const Data& i2) noexcept
336
339
{
337
340
if (i1.m_hash == i2.m_hash )
338
341
{
@@ -357,19 +360,16 @@ class ConnectionsPool
357
360
Data* m_next;
358
361
Data* m_prev;
359
362
360
- Data (const Data&);
361
- Data& operator =(const Data&);
362
-
363
363
// create instance used to search for recently used connection by hash
364
- explicit Data (ULONG hash)
364
+ explicit Data (ULONG hash) noexcept
365
365
{
366
366
clear ();
367
367
m_conn = NULL ;
368
368
m_hash = hash;
369
369
m_lastUsed = MAX_SINT64;
370
370
}
371
371
372
- void clear ()
372
+ void clear () noexcept
373
373
{
374
374
m_connPool = NULL ;
375
375
// m_conn = NULL;
@@ -497,15 +497,15 @@ class Connection : public Firebird::PermanentStorage
497
497
m_cryptCallbackRedir.setRedirect (attCallback);
498
498
}
499
499
500
- void setBoundAtt (Jrd::Attachment* att) { m_boundAtt = att; }
500
+ void setBoundAtt (Jrd::Attachment* att) noexcept { m_boundAtt = att; }
501
501
502
502
public:
503
- Provider* getProvider () { return &m_provider; }
503
+ Provider* getProvider () noexcept { return &m_provider; }
504
504
505
- Jrd::Attachment* getBoundAtt () const { return m_boundAtt; }
505
+ Jrd::Attachment* getBoundAtt () const noexcept { return m_boundAtt; }
506
506
507
- ConnectionsPool* getConnPool () { return m_poolData.getConnPool (); }
508
- ConnectionsPool::Data* getPoolData () { return &m_poolData; }
507
+ ConnectionsPool* getConnPool () noexcept { return m_poolData.getConnPool (); }
508
+ ConnectionsPool::Data* getPoolData () noexcept { return &m_poolData; }
509
509
510
510
virtual void attach (Jrd::thread_db* tdbb) = 0;
511
511
virtual void detach (Jrd::thread_db* tdbb);
@@ -515,7 +515,7 @@ class Connection : public Firebird::PermanentStorage
515
515
// Try to reset connection, return true if it can be pooled
516
516
virtual bool resetSession (Jrd::thread_db* tdbb) = 0;
517
517
518
- int getSqlDialect () const { return m_sqlDialect; }
518
+ int getSqlDialect () const noexcept { return m_sqlDialect; }
519
519
520
520
// Is this connections can be used by current needs ? Not every DBMS
521
521
// allows to use same connection in more than one transaction and\or
@@ -532,7 +532,7 @@ class Connection : public Firebird::PermanentStorage
532
532
// only Internal provider is able to create "current" connections
533
533
virtual bool isCurrent () const { return false ; }
534
534
535
- bool isBroken () const
535
+ bool isBroken () const noexcept
536
536
{
537
537
return m_broken;
538
538
}
@@ -550,8 +550,8 @@ class Connection : public Firebird::PermanentStorage
550
550
void raise (const Jrd::FbStatusVector* status, Jrd::thread_db* tdbb, const char * sWhere );
551
551
552
552
// will we wrap external errors into our ones (isc_eds_xxx) or pass them as is
553
- bool getWrapErrors (const ISC_STATUS* status);
554
- void setWrapErrors (bool val) { m_wrapErrors = val; }
553
+ bool getWrapErrors (const ISC_STATUS* status) noexcept ;
554
+ void setWrapErrors (bool val) noexcept { m_wrapErrors = val; }
555
555
556
556
// Transactions management within connection scope : put newly created
557
557
// transaction into m_transactions array and delete not needed transaction
@@ -569,18 +569,18 @@ class Connection : public Firebird::PermanentStorage
569
569
virtual Blob* createBlob () = 0;
570
570
571
571
// Test specified feature flag
572
- bool testFeature (info_features value) const { return m_features[value]; }
572
+ bool testFeature (info_features value) const noexcept { return m_features[value]; }
573
573
// Set specified flag
574
- void setFeature (info_features value) { m_features[value] = true ; }
574
+ void setFeature (info_features value) noexcept { m_features[value] = true ; }
575
575
// Clear specified flag
576
- void clearFeature (info_features value) { m_features[value] = false ; }
576
+ void clearFeature (info_features value) noexcept { m_features[value] = false ; }
577
577
578
578
void resetRedirect (Firebird::ICryptKeyCallback* originalCallback)
579
579
{
580
580
m_cryptCallbackRedir.resetRedirect (originalCallback);
581
581
}
582
582
583
- bool hasValidCryptCallback () const
583
+ bool hasValidCryptCallback () const noexcept
584
584
{
585
585
return m_cryptCallbackRedir.isValid ();
586
586
}
@@ -631,11 +631,11 @@ class Transaction : public Firebird::PermanentStorage
631
631
632
632
public:
633
633
634
- Provider* getProvider () { return &m_provider; }
634
+ Provider* getProvider () noexcept { return &m_provider; }
635
635
636
- Connection* getConnection () { return &m_connection; }
636
+ Connection* getConnection () noexcept { return &m_connection; }
637
637
638
- TraScope getScope () const { return m_scope; }
638
+ TraScope getScope () const noexcept { return m_scope; }
639
639
640
640
virtual void start (Jrd::thread_db* tdbb, TraScope traScope, TraModes traMode,
641
641
bool readOnly, bool wait, int lockTimeout);
@@ -684,11 +684,11 @@ class Statement : public Firebird::PermanentStorage
684
684
public:
685
685
static void deleteStatement (Jrd::thread_db* tdbb, Statement* stmt);
686
686
687
- Provider* getProvider () { return &m_provider; }
687
+ Provider* getProvider () noexcept { return &m_provider; }
688
688
689
- Connection* getConnection () { return &m_connection; }
689
+ Connection* getConnection () noexcept { return &m_connection; }
690
690
691
- Transaction* getTransaction () { return m_transaction; }
691
+ Transaction* getTransaction () noexcept { return m_transaction; }
692
692
693
693
void prepare (Jrd::thread_db* tdbb, Transaction* tran, const Firebird::string& sql, bool named);
694
694
void setTimeout (Jrd::thread_db* tdbb, unsigned int timeout);
@@ -702,19 +702,19 @@ class Statement : public Firebird::PermanentStorage
702
702
void close (Jrd::thread_db* tdbb, bool invalidTran = false );
703
703
void deallocate (Jrd::thread_db* tdbb);
704
704
705
- const Firebird::string& getSql () const { return m_sql; }
705
+ const Firebird::string& getSql () const noexcept { return m_sql; }
706
706
707
- void setCallerPrivileges (bool use) { m_callerPrivileges = use; }
707
+ void setCallerPrivileges (bool use) noexcept { m_callerPrivileges = use; }
708
708
709
- bool isActive () const { return m_active; }
709
+ bool isActive () const noexcept { return m_active; }
710
710
711
- bool isAllocated () const { return m_allocated; }
711
+ bool isAllocated () const noexcept { return m_allocated; }
712
712
713
- bool isSelectable () const { return m_stmt_selectable; }
713
+ bool isSelectable () const noexcept { return m_stmt_selectable; }
714
714
715
- unsigned int getInputs () const { return m_inputs; }
715
+ unsigned int getInputs () const noexcept { return m_inputs; }
716
716
717
- unsigned int getOutputs () const { return m_outputs; }
717
+ unsigned int getOutputs () const noexcept { return m_outputs; }
718
718
719
719
// Get error description from provider and put it with additional contex
720
720
// info into locally raised exception
0 commit comments