#include <RecordFieldId.h>
Collaboration diagram for casa::RecordFieldId:

Part of API
RecordFieldId gives the identification of a field in a record.
This class provides the user to identify a field in a record. Identification can be done by means of the field name or by means of its field number.
For the programmer the most convenient way is probably the name, because that is the natural identification. However, identification by means of field number is much faster and could be used when it is known.
void someFunc (const Record& record) { float value1 = record.asfloat ("name"); // identify by name float value2 = record.asfloat (0); // identify by number }
This class makes it possible that many functions in Record classes have to be defined only once. The constructors of RecordFieldId make it possible that a number and a string are automatically converted, so the user does not have to instantiate a RecordFieldId object explicitly.
Definition at line 91 of file RecordFieldId.h.
Public Member Functions | |
| RecordFieldId (Int fieldNumber) | |
| Construct it from a field number. | |
| Int | fieldNumber () const |
| Get the field number. | |
| const String & | fieldName () const |
| Get the field name. | |
| Bool | byName () const |
| Is the id given by name? | |
| RecordFieldId (const String &name) | |
| Construct it from a field name. | |
| RecordFieldId (const std::string &name) | |
| RecordFieldId (const Char *name) | |
Private Attributes | |
| Bool | byName_p |
| Int | number_p |
| String | name_p |
| casa::RecordFieldId::RecordFieldId | ( | Int | fieldNumber | ) | [inline] |
| casa::RecordFieldId::RecordFieldId | ( | const String & | name | ) | [inline] |
| casa::RecordFieldId::RecordFieldId | ( | const std::string & | name | ) | [inline] |
Definition at line 132 of file RecordFieldId.h.
| casa::RecordFieldId::RecordFieldId | ( | const Char * | name | ) | [inline] |
Definition at line 138 of file RecordFieldId.h.
| Int casa::RecordFieldId::fieldNumber | ( | ) | const [inline] |
| const String & casa::RecordFieldId::fieldName | ( | ) | const [inline] |
| Bool casa::RecordFieldId::byName | ( | ) | const [inline] |
Bool casa::RecordFieldId::byName_p [private] |
Int casa::RecordFieldId::number_p [private] |
String casa::RecordFieldId::name_p [private] |
1.5.1