OEFieldBase
class OEFieldBase
The OEFieldBase class is a base class for the templated OEField classes used to set and get data from OERecord objects. In most cases, the templated, concrete OEField objects should be used.
Constructors
OEFieldBase()
The default constructor initializes the field object to an invalid field with no name or type.
OEFieldBase(const OEFieldBase &rhs)
Copy constructor.
GetName
std::string GetName() const
Returns the field’s name.
SetName
void SetName(const std::string &name)
Sets the name of the field.
GetTypeName
std::string GetTypeName() const
Returns the name of the field’s type.
IsNullable
bool IsNullable() const
Returns true if the field allows setting of null values.
IsReadonly
bool IsReadonly() const
Returns true if the field only allows reading, but not writing, of data onto a record.
IsValid
bool IsValid() const
Returns true if the field has been initialized.
GetMeta
OEFieldMeta GetMeta() const
Returns the metadata associated with this field. If the field has no metadata, an empty OEFieldMeta object is returned.
SetMeta
void SetMeta(const OEFieldMeta &meta)
Sets metadata for this field.
See also
OEField
class OEField
The OEField class is a templated subclass of OEFieldBase and is templated on types that can be stored on OERecord.
The following methods are publicly inherited from OEFieldBase:
Constructors
template<class T> OEField<T>::OEField(const std::string &name, OEFieldMeta meta=OEFieldMeta(), bool readonly=false, bool nullable=false)
This constructor initializes the field object with the specified type, name, and metadata, and sets the readonly and nullable states of the field.
The Types namespace contains the types of
T that are supported.
Note
OEField objects are best created using the
OEMakeField function instead of this
constructor method.
See also
template<class T> OEField<T>::OEField(const OEFieldBase &f)
Copy constructor.
GetType
OEFieldType<T> GetType() const
Returns an OEFieldType object representing the type of objects stored and retrieved by this field.
OEVectorField
class OEVectorField
The OEVectorField class is a templated subclass of OEFieldBase and is templated on types that can be stored in vectors on OERecord.
Constructors
template<class T> OEVectorField<T>::OEVectorField(const std::string &name, OEFieldMeta meta=OEFieldMeta(), bool readonly=false, bool nullable=false)
This constructor initializes the field object with the specified type, name, and metadata, and sets the readonly and nullable states of the field. An OEVectorField<T> can store and retrieve std::vector<T> objects to and from records.
See the Types namespace for types of
T that are supported.
Note
OEVectorField objects are best created using the
OEMakeField function instead of this
constructor method.
template<class T> OEVectorField<T>::OEVectorField(const OEFieldBase &f)
Copy constructor.
GetType
OEVectorFieldType<T> GetType() const
Returns an OEVectorFieldType object representing the type of objects stored and retrieved by this field.
OEMatchField
class OEMatchField
The OEMatchField class is a templated subclass of OEField. It is used to retrieve values from an OERecord object when the name of the field is unknown. An OEMatchField object acts as a surrogate for the first field of a record that matches the type and metadata.
Constructors
OEMatchField(const std::string &name, OEFieldMeta meta=OEFieldMeta(), bool readonly=false, bool nullable=false)
This constructor initializes the match field object with the specified type, name, and metadata, and sets the readonly and nullable states of the field. The provided name parameter is only used if the match field creates a new field on a record.
Note
OEMatchField objects are best created using the
OEMakeMatchField function instead of this
constructor method.
See also
OEMatchVectorField
class OEMatchVectorField
The OEMatchVectorField class is a templated subclass of OEVectorField. It is used to retrieve values from an OERecord object when the name of the field is unknown. An OEMatchVectorField object acts as a surrogate for the first vector field of a record that matches the type and metadata.
Constructors
OEMatchVectorField(const std::string &name, OEFieldMeta meta=OEFieldMeta(), bool readonly=false, bool nullable=false)
This constructor initializes the match field object with the specified type, name, and metadata, and sets the readonly and nullable states of the field. The provided name parameter is only used if the match field creates a new field on a record.
Note
OEMatchVectorField objects are best created using the
OEMakeMatchField function instead of this
constructor method.
See also
OEVectorField
OEMatchField
class OEMatchField
OEMatchField is a factory function returning a specialized match field object. The returned match field is used to retrieve values from an OERecord object when the name of the field is unknown. An OEMatchField object acts as a surrogate for the first field of a record that matches the type and metadata.
OEMatchField(name: str, meta: OEFieldMeta, read_only: bool=False, nullable: bool=False)
- name
The name to be given to the created match field. It is only used if the match field is used to create a new field on a record.
- meta
An OEFieldMeta object containing metadata for the returned match field.
- read_only
If True, the returned match field can only be used for reading from, and not writing to, OERecord objects.
- nullable
If True, the returned match field can be used to set null values onto an OERecord.
See also