Skip to content

Commit 782b781

Browse files
committed
Mark overrides in MsgMetaData
+ some noexcept and constness
1 parent e6701a2 commit 782b781

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

src/common/MsgMetadata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ IMessageMetadata* MetadataBuilder::getMetadata(CheckStatusWrapper* status)
298298

299299
metadataError("getMetadata");
300300

301-
unsigned i = msgMetadata->makeOffsets();
301+
const unsigned i = msgMetadata->makeOffsets();
302302
if (i != ~0u)
303303
{
304304
(Arg::Gds(isc_item_finish) << Arg::Num(i)).raise();
@@ -413,7 +413,7 @@ void MsgMetadata::assign(IMessageMetadata* from)
413413
LocalStatus ls;
414414
CheckStatusWrapper status(&ls);
415415

416-
unsigned count = from->getCount(&status);
416+
const unsigned count = from->getCount(&status);
417417
check(&status);
418418
items.resize(count);
419419

src/common/MsgMetadata.h

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
138138
return items[n];
139139
}
140140

141-
unsigned getMessageLength()
141+
unsigned getMessageLength() const noexcept
142142
{
143143
return length;
144144
}
145145

146-
unsigned getCount()
146+
unsigned getCount() const noexcept
147147
{
148148
return items.getCount();
149149
}
@@ -154,12 +154,12 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
154154
}
155155

156156
// IMessageMetadata implementation
157-
unsigned getCount(CheckStatusWrapper* /*status*/)
157+
unsigned getCount(CheckStatusWrapper* /*status*/) override
158158
{
159159
return (unsigned) items.getCount();
160160
}
161161

162-
const char* getField(CheckStatusWrapper* status, unsigned index)
162+
const char* getField(CheckStatusWrapper* status, unsigned index) override
163163
{
164164
if (index < items.getCount())
165165
return items[index].field.c_str();
@@ -168,7 +168,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
168168
return NULL;
169169
}
170170

171-
const char* getSchema(CheckStatusWrapper* status, unsigned index)
171+
const char* getSchema(CheckStatusWrapper* status, unsigned index) override
172172
{
173173
if (index < items.getCount())
174174
return items[index].schema.c_str();
@@ -177,7 +177,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
177177
return NULL;
178178
}
179179

180-
const char* getRelation(CheckStatusWrapper* status, unsigned index)
180+
const char* getRelation(CheckStatusWrapper* status, unsigned index) override
181181
{
182182
if (index < items.getCount())
183183
return items[index].relation.c_str();
@@ -186,7 +186,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
186186
return NULL;
187187
}
188188

189-
const char* getOwner(CheckStatusWrapper* status, unsigned index)
189+
const char* getOwner(CheckStatusWrapper* status, unsigned index) override
190190
{
191191
if (index < items.getCount())
192192
return items[index].owner.c_str();
@@ -195,7 +195,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
195195
return NULL;
196196
}
197197

198-
const char* getAlias(CheckStatusWrapper* status, unsigned index)
198+
const char* getAlias(CheckStatusWrapper* status, unsigned index) override
199199
{
200200
if (index < items.getCount())
201201
return items[index].alias.c_str();
@@ -204,7 +204,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
204204
return NULL;
205205
}
206206

207-
unsigned getType(CheckStatusWrapper* status, unsigned index)
207+
unsigned getType(CheckStatusWrapper* status, unsigned index) override
208208
{
209209
if (index < items.getCount())
210210
return items[index].type;
@@ -213,7 +213,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
213213
return 0;
214214
}
215215

216-
FB_BOOLEAN isNullable(CheckStatusWrapper* status, unsigned index)
216+
FB_BOOLEAN isNullable(CheckStatusWrapper* status, unsigned index) override
217217
{
218218
if (index < items.getCount())
219219
return items[index].nullable;
@@ -222,7 +222,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
222222
return false;
223223
}
224224

225-
int getSubType(CheckStatusWrapper* status, unsigned index)
225+
int getSubType(CheckStatusWrapper* status, unsigned index) override
226226
{
227227
if (index < items.getCount())
228228
return items[index].subType;
@@ -231,7 +231,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
231231
return 0;
232232
}
233233

234-
unsigned getLength(CheckStatusWrapper* status, unsigned index)
234+
unsigned getLength(CheckStatusWrapper* status, unsigned index) override
235235
{
236236
if (index < items.getCount())
237237
return items[index].length;
@@ -240,7 +240,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
240240
return 0;
241241
}
242242

243-
int getScale(CheckStatusWrapper* status, unsigned index)
243+
int getScale(CheckStatusWrapper* status, unsigned index) override
244244
{
245245
if (index < items.getCount())
246246
return items[index].scale;
@@ -249,7 +249,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
249249
return 0;
250250
}
251251

252-
unsigned getCharSet(CheckStatusWrapper* status, unsigned index)
252+
unsigned getCharSet(CheckStatusWrapper* status, unsigned index) override
253253
{
254254
if (index < items.getCount())
255255
return items[index].charSet;
@@ -258,7 +258,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
258258
return 0;
259259
}
260260

261-
unsigned getOffset(CheckStatusWrapper* status, unsigned index)
261+
unsigned getOffset(CheckStatusWrapper* status, unsigned index) override
262262
{
263263
if (index < items.getCount())
264264
return items[index].offset;
@@ -267,7 +267,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
267267
return 0;
268268
}
269269

270-
unsigned getNullOffset(CheckStatusWrapper* status, unsigned index)
270+
unsigned getNullOffset(CheckStatusWrapper* status, unsigned index) override
271271
{
272272
if (index < items.getCount())
273273
return items[index].nullInd;
@@ -276,19 +276,19 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
276276
return 0;
277277
}
278278

279-
IMetadataBuilder* getBuilder(CheckStatusWrapper* status);
279+
IMetadataBuilder* getBuilder(CheckStatusWrapper* status) override;
280280

281-
unsigned getMessageLength(CheckStatusWrapper* /*status*/)
281+
unsigned getMessageLength(CheckStatusWrapper* /*status*/) override
282282
{
283283
return length;
284284
}
285285

286-
unsigned getAlignment(CheckStatusWrapper* /*status*/)
286+
unsigned getAlignment(CheckStatusWrapper* /*status*/) override
287287
{
288288
return alignment;
289289
}
290290

291-
unsigned getAlignedLength(CheckStatusWrapper* /*status*/)
291+
unsigned getAlignedLength(CheckStatusWrapper* /*status*/) override
292292
{
293293
return alignedLength;
294294
}
@@ -298,7 +298,7 @@ class MsgMetadata : public RefCntIface<IMessageMetadataImpl<MsgMetadata, CheckSt
298298
unsigned makeOffsets();
299299

300300
private:
301-
void raiseIndexError(CheckStatusWrapper* status, unsigned index, const char* method) const
301+
[[noreturn]] void raiseIndexError(CheckStatusWrapper* status, unsigned index, const char* method) const
302302
{
303303
(Arg::Gds(isc_invalid_index_val) <<
304304
Arg::Num(index) << (string("IMessageMetadata::") + method)).copyTo(status);
@@ -330,21 +330,21 @@ class MetadataBuilder final :
330330
MetadataBuilder(unsigned fieldCount);
331331

332332
// IMetadataBuilder implementation
333-
void setType(CheckStatusWrapper* status, unsigned index, unsigned type);
334-
void setSubType(CheckStatusWrapper* status, unsigned index, int subType);
335-
void setLength(CheckStatusWrapper* status, unsigned index, unsigned length);
336-
void setCharSet(CheckStatusWrapper* status, unsigned index, unsigned charSet);
337-
void setScale(CheckStatusWrapper* status, unsigned index, int scale);
338-
void truncate(CheckStatusWrapper* status, unsigned count);
339-
void remove(CheckStatusWrapper* status, unsigned index);
340-
void moveNameToIndex(CheckStatusWrapper* status, const char* name, unsigned index);
341-
unsigned addField(CheckStatusWrapper* status);
342-
IMessageMetadata* getMetadata(CheckStatusWrapper* status);
343-
void setField(CheckStatusWrapper* status, unsigned index, const char* field);
344-
void setSchema(CheckStatusWrapper* status, unsigned index, const char* schema);
345-
void setRelation(CheckStatusWrapper* status, unsigned index, const char* relation);
346-
void setOwner(CheckStatusWrapper* status, unsigned index, const char* owner);
347-
void setAlias(CheckStatusWrapper* status, unsigned index, const char* alias);
333+
void setType(CheckStatusWrapper* status, unsigned index, unsigned type) override;
334+
void setSubType(CheckStatusWrapper* status, unsigned index, int subType) override;
335+
void setLength(CheckStatusWrapper* status, unsigned index, unsigned length) override;
336+
void setCharSet(CheckStatusWrapper* status, unsigned index, unsigned charSet) override;
337+
void setScale(CheckStatusWrapper* status, unsigned index, int scale) override;
338+
void truncate(CheckStatusWrapper* status, unsigned count) override;
339+
void remove(CheckStatusWrapper* status, unsigned index) override;
340+
void moveNameToIndex(CheckStatusWrapper* status, const char* name, unsigned index) override;
341+
unsigned addField(CheckStatusWrapper* status) override;
342+
IMessageMetadata* getMetadata(CheckStatusWrapper* status) override;
343+
void setField(CheckStatusWrapper* status, unsigned index, const char* field) override;
344+
void setSchema(CheckStatusWrapper* status, unsigned index, const char* schema) override;
345+
void setRelation(CheckStatusWrapper* status, unsigned index, const char* relation) override;
346+
void setOwner(CheckStatusWrapper* status, unsigned index, const char* owner) override;
347+
void setAlias(CheckStatusWrapper* status, unsigned index, const char* alias) override;
348348

349349
private:
350350
RefPtr<MsgMetadata> msgMetadata;

0 commit comments

Comments
 (0)